3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8 #error Cython requires Python 2.6+ or Python 3.3+.
10 #define CYTHON_ABI "0_28_5"
11 #define CYTHON_FUTURE_DIVISION 0
14 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #if !defined(WIN32) && !defined(MS_WINDOWS)
28 #define DL_IMPORT(t) t
31 #define DL_EXPORT(t) t
34 #ifndef HAVE_LONG_LONG
35 #if PY_VERSION_HEX >= 0x02070000
36 #define HAVE_LONG_LONG
40 #define PY_LONG_LONG LONG_LONG
43 #define Py_HUGE_VAL HUGE_VAL
46 #define CYTHON_COMPILING_IN_PYPY 1
47 #define CYTHON_COMPILING_IN_PYSTON 0
48 #define CYTHON_COMPILING_IN_CPYTHON 0
49 #undef CYTHON_USE_TYPE_SLOTS
50 #define CYTHON_USE_TYPE_SLOTS 0
51 #undef CYTHON_USE_PYTYPE_LOOKUP
52 #define CYTHON_USE_PYTYPE_LOOKUP 0
53 #if PY_VERSION_HEX < 0x03050000
54 #undef CYTHON_USE_ASYNC_SLOTS
55 #define CYTHON_USE_ASYNC_SLOTS 0
56 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
57 #define CYTHON_USE_ASYNC_SLOTS 1
59 #undef CYTHON_USE_PYLIST_INTERNALS
60 #define CYTHON_USE_PYLIST_INTERNALS 0
61 #undef CYTHON_USE_UNICODE_INTERNALS
62 #define CYTHON_USE_UNICODE_INTERNALS 0
63 #undef CYTHON_USE_UNICODE_WRITER
64 #define CYTHON_USE_UNICODE_WRITER 0
65 #undef CYTHON_USE_PYLONG_INTERNALS
66 #define CYTHON_USE_PYLONG_INTERNALS 0
67 #undef CYTHON_AVOID_BORROWED_REFS
68 #define CYTHON_AVOID_BORROWED_REFS 1
69 #undef CYTHON_ASSUME_SAFE_MACROS
70 #define CYTHON_ASSUME_SAFE_MACROS 0
71 #undef CYTHON_UNPACK_METHODS
72 #define CYTHON_UNPACK_METHODS 0
73 #undef CYTHON_FAST_THREAD_STATE
74 #define CYTHON_FAST_THREAD_STATE 0
75 #undef CYTHON_FAST_PYCALL
76 #define CYTHON_FAST_PYCALL 0
77 #undef CYTHON_PEP489_MULTI_PHASE_INIT
78 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
79 #undef CYTHON_USE_TP_FINALIZE
80 #define CYTHON_USE_TP_FINALIZE 0
81 #elif defined(PYSTON_VERSION)
82 #define CYTHON_COMPILING_IN_PYPY 0
83 #define CYTHON_COMPILING_IN_PYSTON 1
84 #define CYTHON_COMPILING_IN_CPYTHON 0
85 #ifndef CYTHON_USE_TYPE_SLOTS
86 #define CYTHON_USE_TYPE_SLOTS 1
88 #undef CYTHON_USE_PYTYPE_LOOKUP
89 #define CYTHON_USE_PYTYPE_LOOKUP 0
90 #undef CYTHON_USE_ASYNC_SLOTS
91 #define CYTHON_USE_ASYNC_SLOTS 0
92 #undef CYTHON_USE_PYLIST_INTERNALS
93 #define CYTHON_USE_PYLIST_INTERNALS 0
94 #ifndef CYTHON_USE_UNICODE_INTERNALS
95 #define CYTHON_USE_UNICODE_INTERNALS 1
97 #undef CYTHON_USE_UNICODE_WRITER
98 #define CYTHON_USE_UNICODE_WRITER 0
99 #undef CYTHON_USE_PYLONG_INTERNALS
100 #define CYTHON_USE_PYLONG_INTERNALS 0
101 #ifndef CYTHON_AVOID_BORROWED_REFS
102 #define CYTHON_AVOID_BORROWED_REFS 0
104 #ifndef CYTHON_ASSUME_SAFE_MACROS
105 #define CYTHON_ASSUME_SAFE_MACROS 1
107 #ifndef CYTHON_UNPACK_METHODS
108 #define CYTHON_UNPACK_METHODS 1
110 #undef CYTHON_FAST_THREAD_STATE
111 #define CYTHON_FAST_THREAD_STATE 0
112 #undef CYTHON_FAST_PYCALL
113 #define CYTHON_FAST_PYCALL 0
114 #undef CYTHON_PEP489_MULTI_PHASE_INIT
115 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
116 #undef CYTHON_USE_TP_FINALIZE
117 #define CYTHON_USE_TP_FINALIZE 0
119 #define CYTHON_COMPILING_IN_PYPY 0
120 #define CYTHON_COMPILING_IN_PYSTON 0
121 #define CYTHON_COMPILING_IN_CPYTHON 1
122 #ifndef CYTHON_USE_TYPE_SLOTS
123 #define CYTHON_USE_TYPE_SLOTS 1
125 #if PY_VERSION_HEX < 0x02070000
126 #undef CYTHON_USE_PYTYPE_LOOKUP
127 #define CYTHON_USE_PYTYPE_LOOKUP 0
128 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
129 #define CYTHON_USE_PYTYPE_LOOKUP 1
131 #if PY_MAJOR_VERSION < 3
132 #undef CYTHON_USE_ASYNC_SLOTS
133 #define CYTHON_USE_ASYNC_SLOTS 0
134 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
135 #define CYTHON_USE_ASYNC_SLOTS 1
137 #if PY_VERSION_HEX < 0x02070000
138 #undef CYTHON_USE_PYLONG_INTERNALS
139 #define CYTHON_USE_PYLONG_INTERNALS 0
140 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
141 #define CYTHON_USE_PYLONG_INTERNALS 1
143 #ifndef CYTHON_USE_PYLIST_INTERNALS
144 #define CYTHON_USE_PYLIST_INTERNALS 1
146 #ifndef CYTHON_USE_UNICODE_INTERNALS
147 #define CYTHON_USE_UNICODE_INTERNALS 1
149 #if PY_VERSION_HEX < 0x030300F0
150 #undef CYTHON_USE_UNICODE_WRITER
151 #define CYTHON_USE_UNICODE_WRITER 0
152 #elif !defined(CYTHON_USE_UNICODE_WRITER)
153 #define CYTHON_USE_UNICODE_WRITER 1
155 #ifndef CYTHON_AVOID_BORROWED_REFS
156 #define CYTHON_AVOID_BORROWED_REFS 0
158 #ifndef CYTHON_ASSUME_SAFE_MACROS
159 #define CYTHON_ASSUME_SAFE_MACROS 1
161 #ifndef CYTHON_UNPACK_METHODS
162 #define CYTHON_UNPACK_METHODS 1
164 #ifndef CYTHON_FAST_THREAD_STATE
165 #define CYTHON_FAST_THREAD_STATE 1
167 #ifndef CYTHON_FAST_PYCALL
168 #define CYTHON_FAST_PYCALL 1
170 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
171 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
173 #ifndef CYTHON_USE_TP_FINALIZE
174 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
177 #if !defined(CYTHON_FAST_PYCCALL)
178 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
180 #if CYTHON_USE_PYLONG_INTERNALS
181 #include "longintrepr.h"
186 #ifndef __has_attribute
187 #define __has_attribute(x) 0
189 #ifndef __has_cpp_attribute
190 #define __has_cpp_attribute(x) 0
192 #ifndef CYTHON_RESTRICT
193 #if defined(__GNUC__)
194 #define CYTHON_RESTRICT __restrict__
195 #elif defined(_MSC_VER) && _MSC_VER >= 1400
196 #define CYTHON_RESTRICT __restrict
197 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
198 #define CYTHON_RESTRICT restrict
200 #define CYTHON_RESTRICT
203 #ifndef CYTHON_UNUSED
204 # if defined(__GNUC__)
205 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
206 # define CYTHON_UNUSED __attribute__ ((__unused__))
208 # define CYTHON_UNUSED
210 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
211 # define CYTHON_UNUSED __attribute__ ((__unused__))
213 # define CYTHON_UNUSED
216 #ifndef CYTHON_MAYBE_UNUSED_VAR
217 # if defined(__cplusplus)
218 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
220 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
223 #ifndef CYTHON_NCP_UNUSED
224 # if CYTHON_COMPILING_IN_CPYTHON
225 # define CYTHON_NCP_UNUSED
227 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
230 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
232 #ifndef _MSC_STDINT_H_
234 typedef unsigned char uint8_t;
235 typedef unsigned int uint32_t;
237 typedef unsigned __int8 uint8_t;
238 typedef unsigned __int32 uint32_t;
244 #ifndef CYTHON_FALLTHROUGH
245 #if defined(__cplusplus) && __cplusplus >= 201103L
246 #if __has_cpp_attribute(fallthrough)
247 #define CYTHON_FALLTHROUGH [[fallthrough]]
248 #elif __has_cpp_attribute(clang::fallthrough)
249 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
250 #elif __has_cpp_attribute(gnu::fallthrough)
251 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
254 #ifndef CYTHON_FALLTHROUGH
255 #if __has_attribute(fallthrough)
256 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
258 #define CYTHON_FALLTHROUGH
261 #if defined(__clang__ ) && defined(__apple_build_version__)
262 #if __apple_build_version__ < 7000000
263 #undef CYTHON_FALLTHROUGH
264 #define CYTHON_FALLTHROUGH
269 #ifndef CYTHON_INLINE
270 #if defined(__clang__)
271 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
272 #elif defined(__GNUC__)
273 #define CYTHON_INLINE __inline__
274 #elif defined(_MSC_VER)
275 #define CYTHON_INLINE __inline
276 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
277 #define CYTHON_INLINE inline
279 #define CYTHON_INLINE
283 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
284 #define Py_OptimizeFlag 0
286 #define __PYX_BUILD_PY_SSIZE_T "n"
287 #define CYTHON_FORMAT_SSIZE_T "z"
288 #if PY_MAJOR_VERSION < 3
289 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
290 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
291 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
292 #define __Pyx_DefaultClassType PyClass_Type
294 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
295 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
296 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
297 #define __Pyx_DefaultClassType PyType_Type
299 #ifndef Py_TPFLAGS_CHECKTYPES
300 #define Py_TPFLAGS_CHECKTYPES 0
302 #ifndef Py_TPFLAGS_HAVE_INDEX
303 #define Py_TPFLAGS_HAVE_INDEX 0
305 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
306 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
308 #ifndef Py_TPFLAGS_HAVE_FINALIZE
309 #define Py_TPFLAGS_HAVE_FINALIZE 0
311 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
312 #ifndef METH_FASTCALL
313 #define METH_FASTCALL 0x80
315 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
316 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
317 Py_ssize_t nargs, PyObject *kwnames);
319 #define __Pyx_PyCFunctionFast _PyCFunctionFast
320 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
322 #if CYTHON_FAST_PYCCALL
323 #define __Pyx_PyFastCFunction_Check(func)\
324 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
326 #define __Pyx_PyFastCFunction_Check(func) 0
328 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
329 #define PyObject_Malloc(s) PyMem_Malloc(s)
330 #define PyObject_Free(p) PyMem_Free(p)
331 #define PyObject_Realloc(p) PyMem_Realloc(p)
333 #if CYTHON_COMPILING_IN_PYSTON
334 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
335 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
337 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
338 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
340 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
341 #define __Pyx_PyThreadState_Current PyThreadState_GET()
342 #elif PY_VERSION_HEX >= 0x03060000
343 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
344 #elif PY_VERSION_HEX >= 0x03000000
345 #define __Pyx_PyThreadState_Current PyThreadState_GET()
347 #define __Pyx_PyThreadState_Current _PyThreadState_Current
349 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
350 #include "pythread.h"
351 #define Py_tss_NEEDS_INIT 0
352 typedef int Py_tss_t;
353 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
354 *key = PyThread_create_key();
357 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
358 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
359 *key = Py_tss_NEEDS_INIT;
362 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
365 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
366 return *key != Py_tss_NEEDS_INIT;
368 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
369 PyThread_delete_key(*key);
370 *key = Py_tss_NEEDS_INIT;
372 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
373 return PyThread_set_key_value(*key, value);
375 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
376 return PyThread_get_key_value(*key);
378 #endif // TSS (Thread Specific Storage) API
379 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
380 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
382 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
384 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
385 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
386 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
388 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
389 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
391 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
392 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
394 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
396 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
397 #define CYTHON_PEP393_ENABLED 1
398 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
399 0 : _PyUnicode_Ready((PyObject *)(op)))
400 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
401 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
402 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
403 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
404 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
405 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
406 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
407 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
409 #define CYTHON_PEP393_ENABLED 0
410 #define PyUnicode_1BYTE_KIND 1
411 #define PyUnicode_2BYTE_KIND 2
412 #define PyUnicode_4BYTE_KIND 4
413 #define __Pyx_PyUnicode_READY(op) (0)
414 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
415 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
416 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
417 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
418 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
419 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
420 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
421 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
423 #if CYTHON_COMPILING_IN_PYPY
424 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
425 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
427 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
428 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
429 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
431 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
432 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
434 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
435 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
437 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
438 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
440 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
441 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
442 #if PY_MAJOR_VERSION >= 3
443 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
445 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
447 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
448 #define PyObject_ASCII(o) PyObject_Repr(o)
450 #if PY_MAJOR_VERSION >= 3
451 #define PyBaseString_Type PyUnicode_Type
452 #define PyStringObject PyUnicodeObject
453 #define PyString_Type PyUnicode_Type
454 #define PyString_Check PyUnicode_Check
455 #define PyString_CheckExact PyUnicode_CheckExact
456 #define PyObject_Unicode PyObject_Str
458 #if PY_MAJOR_VERSION >= 3
459 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
460 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
462 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
463 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
465 #ifndef PySet_CheckExact
466 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
468 #if CYTHON_ASSUME_SAFE_MACROS
469 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
471 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
473 #if PY_MAJOR_VERSION >= 3
474 #define PyIntObject PyLongObject
475 #define PyInt_Type PyLong_Type
476 #define PyInt_Check(op) PyLong_Check(op)
477 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
478 #define PyInt_FromString PyLong_FromString
479 #define PyInt_FromUnicode PyLong_FromUnicode
480 #define PyInt_FromLong PyLong_FromLong
481 #define PyInt_FromSize_t PyLong_FromSize_t
482 #define PyInt_FromSsize_t PyLong_FromSsize_t
483 #define PyInt_AsLong PyLong_AsLong
484 #define PyInt_AS_LONG PyLong_AS_LONG
485 #define PyInt_AsSsize_t PyLong_AsSsize_t
486 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
487 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
488 #define PyNumber_Int PyNumber_Long
490 #if PY_MAJOR_VERSION >= 3
491 #define PyBoolObject PyLongObject
493 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
494 #ifndef PyUnicode_InternFromString
495 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
498 #if PY_VERSION_HEX < 0x030200A4
499 typedef long Py_hash_t;
500 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
501 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
503 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
504 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
506 #if PY_MAJOR_VERSION >= 3
507 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
509 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
511 #if CYTHON_USE_ASYNC_SLOTS
512 #if PY_VERSION_HEX >= 0x030500B1
513 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
514 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
516 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
519 #define __Pyx_PyType_AsAsync(obj) NULL
521 #ifndef __Pyx_PyAsyncMethodsStruct
526 } __Pyx_PyAsyncMethodsStruct;
529 #if defined(WIN32) || defined(MS_WINDOWS)
530 #define _USE_MATH_DEFINES
534 #define __PYX_NAN() ((float) NAN)
536 static CYTHON_INLINE
float __PYX_NAN() {
538 memset(&value, 0xFF,
sizeof(value));
542 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
543 #define __Pyx_truncl trunc
545 #define __Pyx_truncl truncl
549 #define __PYX_ERR(f_index, lineno, Ln_error) \
551 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
554 #ifndef __PYX_EXTERN_C
556 #define __PYX_EXTERN_C extern "C"
558 #define __PYX_EXTERN_C extern
562 #define __PYX_HAVE__superluWrappers
563 #define __PYX_HAVE_API__superluWrappers
567 #include "numpy/arrayobject.h"
568 #include "numpy/ufuncobject.h"
571 #include "pythread.h"
577 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
578 #define CYTHON_WITHOUT_ASSERTIONS
581 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
582 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
584 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
585 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
586 #define __PYX_DEFAULT_STRING_ENCODING ""
587 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
588 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
589 #define __Pyx_uchar_cast(c) ((unsigned char)c)
590 #define __Pyx_long_cast(x) ((long)x)
591 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
592 (sizeof(type) < sizeof(Py_ssize_t)) ||\
593 (sizeof(type) > sizeof(Py_ssize_t) &&\
594 likely(v < (type)PY_SSIZE_T_MAX ||\
595 v == (type)PY_SSIZE_T_MAX) &&\
596 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
597 v == (type)PY_SSIZE_T_MIN))) ||\
598 (sizeof(type) == sizeof(Py_ssize_t) &&\
599 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
600 v == (type)PY_SSIZE_T_MAX))) )
601 #if defined (__cplusplus) && __cplusplus >= 201103L
603 #define __Pyx_sst_abs(value) std::abs(value)
604 #elif SIZEOF_INT >= SIZEOF_SIZE_T
605 #define __Pyx_sst_abs(value) abs(value)
606 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
607 #define __Pyx_sst_abs(value) labs(value)
608 #elif defined (_MSC_VER)
609 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
610 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
611 #define __Pyx_sst_abs(value) llabs(value)
612 #elif defined (__GNUC__)
613 #define __Pyx_sst_abs(value) __builtin_llabs(value)
615 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
617 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
618 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
619 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
620 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
621 #define __Pyx_PyBytes_FromString PyBytes_FromString
622 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
623 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
624 #if PY_MAJOR_VERSION < 3
625 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
626 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
628 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
629 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
631 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
635 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
636 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
637 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
639 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
640 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
641 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
642 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
643 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
644 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
645 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
646 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
647 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
648 const Py_UNICODE *u_end =
u;
650 return (
size_t)(u_end -
u - 1);
652 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
653 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
654 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
655 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
656 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
657 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
658 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
659 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
660 #define __Pyx_PySequence_Tuple(obj)\
661 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
662 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
663 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
664 #if CYTHON_ASSUME_SAFE_MACROS
665 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
667 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
669 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
670 #if PY_MAJOR_VERSION >= 3
671 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
673 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
675 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
676 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
677 static int __Pyx_sys_getdefaultencoding_not_ascii;
678 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
680 PyObject* default_encoding = NULL;
681 PyObject* ascii_chars_u = NULL;
682 PyObject* ascii_chars_b = NULL;
683 const char* default_encoding_c;
684 sys = PyImport_ImportModule(
"sys");
686 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
688 if (!default_encoding)
goto bad;
689 default_encoding_c = PyBytes_AsString(default_encoding);
690 if (!default_encoding_c)
goto bad;
691 if (strcmp(default_encoding_c,
"ascii") == 0) {
692 __Pyx_sys_getdefaultencoding_not_ascii = 0;
694 char ascii_chars[128];
696 for (
c = 0;
c < 128;
c++) {
699 __Pyx_sys_getdefaultencoding_not_ascii = 1;
700 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
701 if (!ascii_chars_u)
goto bad;
702 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
703 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
706 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
710 Py_DECREF(ascii_chars_u);
711 Py_DECREF(ascii_chars_b);
713 Py_DECREF(default_encoding);
716 Py_XDECREF(default_encoding);
717 Py_XDECREF(ascii_chars_u);
718 Py_XDECREF(ascii_chars_b);
722 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
723 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
725 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
726 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
727 static char* __PYX_DEFAULT_STRING_ENCODING;
728 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
730 PyObject* default_encoding = NULL;
731 char* default_encoding_c;
732 sys = PyImport_ImportModule(
"sys");
734 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
736 if (!default_encoding)
goto bad;
737 default_encoding_c = PyBytes_AsString(default_encoding);
738 if (!default_encoding_c)
goto bad;
739 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
740 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
741 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
742 Py_DECREF(default_encoding);
745 Py_XDECREF(default_encoding);
753 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
754 #define likely(x) __builtin_expect(!!(x), 1)
755 #define unlikely(x) __builtin_expect(!!(x), 0)
757 #define likely(x) (x)
758 #define unlikely(x) (x)
760 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
762 static PyObject *__pyx_m = NULL;
763 static PyObject *__pyx_d;
764 static PyObject *__pyx_b;
765 static PyObject *__pyx_cython_runtime = NULL;
766 static PyObject *__pyx_empty_tuple;
767 static PyObject *__pyx_empty_bytes;
768 static PyObject *__pyx_empty_unicode;
769 static int __pyx_lineno;
770 static int __pyx_clineno = 0;
771 static const char * __pyx_cfilenm= __FILE__;
772 static const char *__pyx_filename;
775 #if !defined(CYTHON_CCOMPLEX)
776 #if defined(__cplusplus)
777 #define CYTHON_CCOMPLEX 1
778 #elif defined(_Complex_I)
779 #define CYTHON_CCOMPLEX 1
781 #define CYTHON_CCOMPLEX 0
791 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
793 #define _Complex_I 1.0fj
797 static const char *__pyx_f[] = {
798 "proteus/superluWrappers.pyx",
800 "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd",
801 "linux2/lib/python2.7/site-packages/Cython/Includes/cpython/type.pxd",
804 struct __pyx_memoryview_obj;
806 struct __pyx_memoryview_obj *memview;
809 Py_ssize_t strides[8];
810 Py_ssize_t suboffsets[8];
811 } __Pyx_memviewslice;
812 #define __Pyx_MemoryView_Len(m) (m.shape[0])
815 #include <pythread.h>
816 #ifndef CYTHON_ATOMICS
817 #define CYTHON_ATOMICS 1
819 #define __pyx_atomic_int_type int
820 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
821 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
823 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
824 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
825 #ifdef __PYX_DEBUG_ATOMICS
826 #warning "Using GNU atomics"
828 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
830 #undef __pyx_atomic_int_type
831 #define __pyx_atomic_int_type LONG
832 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
833 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
834 #ifdef __PYX_DEBUG_ATOMICS
835 #pragma message ("Using MSVC atomics")
837 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
838 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
839 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
840 #ifdef __PYX_DEBUG_ATOMICS
841 #warning "Using Intel atomics"
844 #undef CYTHON_ATOMICS
845 #define CYTHON_ATOMICS 0
846 #ifdef __PYX_DEBUG_ATOMICS
847 #warning "Not using atomics"
850 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
852 #define __pyx_add_acquisition_count(memview)\
853 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
854 #define __pyx_sub_acquisition_count(memview)\
855 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
857 #define __pyx_add_acquisition_count(memview)\
858 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
859 #define __pyx_sub_acquisition_count(memview)\
860 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
864 #ifndef __PYX_FORCE_INIT_THREADS
865 #define __PYX_FORCE_INIT_THREADS 0
869 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
870 #define __Pyx_PyGILState_Release PyGILState_Release
871 #define __Pyx_FastGIL_Remember()
872 #define __Pyx_FastGIL_Forget()
873 #define __Pyx_FastGilFuncInit()
876 #define IS_UNSIGNED(type) (((type) -1) > 0)
877 struct __Pyx_StructField_;
878 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
881 struct __Pyx_StructField_* fields;
889 typedef struct __Pyx_StructField_ {
890 __Pyx_TypeInfo* type;
895 __Pyx_StructField* field;
896 size_t parent_offset;
897 } __Pyx_BufFmt_StackElem;
899 __Pyx_StructField root;
900 __Pyx_BufFmt_StackElem* head;
902 size_t new_count, enc_count;
903 size_t struct_alignment;
909 } __Pyx_BufFmt_Context;
919 typedef npy_int8 __pyx_t_5numpy_int8_t;
928 typedef npy_int16 __pyx_t_5numpy_int16_t;
937 typedef npy_int32 __pyx_t_5numpy_int32_t;
946 typedef npy_int64 __pyx_t_5numpy_int64_t;
955 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
964 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
973 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
982 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
991 typedef npy_float32 __pyx_t_5numpy_float32_t;
1000 typedef npy_float64 __pyx_t_5numpy_float64_t;
1009 typedef npy_long __pyx_t_5numpy_int_t;
1018 typedef npy_longlong __pyx_t_5numpy_long_t;
1027 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1036 typedef npy_ulong __pyx_t_5numpy_uint_t;
1045 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1054 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1063 typedef npy_intp __pyx_t_5numpy_intp_t;
1072 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1081 typedef npy_double __pyx_t_5numpy_float_t;
1090 typedef npy_double __pyx_t_5numpy_double_t;
1099 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1103 typedef ::std::complex< float > __pyx_t_float_complex;
1105 typedef float _Complex __pyx_t_float_complex;
1108 typedef struct {
float real, imag; } __pyx_t_float_complex;
1110 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1115 typedef ::std::complex< double > __pyx_t_double_complex;
1117 typedef double _Complex __pyx_t_double_complex;
1120 typedef struct {
double real, imag; } __pyx_t_double_complex;
1122 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1126 struct __pyx_obj_15superluWrappers_cSparseMatrix;
1127 struct __pyx_obj_15superluWrappers_SparseFactor;
1128 struct __pyx_array_obj;
1129 struct __pyx_MemviewEnum_obj;
1130 struct __pyx_memoryview_obj;
1131 struct __pyx_memoryviewslice_obj;
1140 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1149 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1158 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1167 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1168 struct __pyx_t_15superluWrappers__NRformat;
1169 struct __pyx_t_15superluWrappers__NCformat;
1170 struct __pyx_t_15superluWrappers__DNformat;
1171 struct __pyx_t_15superluWrappers__NCPformat;
1180 struct __pyx_t_15superluWrappers__NRformat {
1181 __pyx_t_5numpy_int32_t
nnz;
1182 __pyx_t_5numpy_float64_t *nzval;
1183 __pyx_t_5numpy_int32_t *colind;
1184 __pyx_t_5numpy_int32_t *rowptr;
1194 struct __pyx_t_15superluWrappers__NCformat {
1195 __pyx_t_5numpy_int32_t
nnz;
1196 __pyx_t_5numpy_float64_t *nzval;
1197 __pyx_t_5numpy_int32_t *rowind;
1198 __pyx_t_5numpy_int32_t *colptr;
1208 struct __pyx_t_15superluWrappers__DNformat {
1209 __pyx_t_5numpy_int32_t lda;
1220 struct __pyx_t_15superluWrappers__NCPformat {
1221 __pyx_t_5numpy_int32_t
nnz;
1223 __pyx_t_5numpy_int32_t *rowind;
1224 __pyx_t_5numpy_int32_t *colbeg;
1225 __pyx_t_5numpy_int32_t *colend;
1235 struct __pyx_obj_15superluWrappers_cSparseMatrix {
1237 __pyx_t_5numpy_int32_t dim[2];
1238 struct __pyx_t_15superluWrappers__NRformat A;
1249 struct __pyx_obj_15superluWrappers_SparseFactor {
1251 struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtab;
1252 superlu_options_t options;
1260 struct __pyx_t_15superluWrappers__NCformat storeA;
1261 struct __pyx_t_15superluWrappers__DNformat storeX;
1265 unsigned int use_same_perm_c;
1266 unsigned int use_same_sparsity;
1278 struct __pyx_array_obj {
1280 struct __pyx_vtabstruct_array *__pyx_vtab;
1286 Py_ssize_t *_strides;
1287 Py_ssize_t itemsize;
1290 void (*callback_free_data)(
void *);
1292 int dtype_is_object;
1303 struct __pyx_MemviewEnum_obj {
1316 struct __pyx_memoryview_obj {
1318 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1321 PyObject *_array_interface;
1322 PyThread_type_lock lock;
1323 __pyx_atomic_int acquisition_count[2];
1324 __pyx_atomic_int *acquisition_count_aligned_p;
1327 int dtype_is_object;
1328 __Pyx_TypeInfo *typeinfo;
1339 struct __pyx_memoryviewslice_obj {
1340 struct __pyx_memoryview_obj __pyx_base;
1341 __Pyx_memviewslice from_slice;
1342 PyObject *from_object;
1343 PyObject *(*to_object_func)(
char *);
1344 int (*to_dtype_func)(
char *, PyObject *);
1357 struct __pyx_vtabstruct_15superluWrappers_SparseFactor {
1358 PyObject *(*_set_mat_types)(
struct __pyx_obj_15superluWrappers_SparseFactor *);
1360 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtabptr_15superluWrappers_SparseFactor;
1371 struct __pyx_vtabstruct_array {
1372 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1374 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1385 struct __pyx_vtabstruct_memoryview {
1386 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1387 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1388 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1389 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1390 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1391 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1392 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1394 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1405 struct __pyx_vtabstruct__memoryviewslice {
1406 struct __pyx_vtabstruct_memoryview __pyx_base;
1408 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1412 #ifndef CYTHON_REFNANNY
1413 #define CYTHON_REFNANNY 0
1417 void (*INCREF)(
void*, PyObject*, int);
1418 void (*DECREF)(
void*, PyObject*, int);
1419 void (*GOTREF)(
void*, PyObject*, int);
1420 void (*GIVEREF)(
void*, PyObject*, int);
1421 void* (*SetupContext)(
const char*, int,
const char*);
1422 void (*FinishContext)(
void**);
1423 } __Pyx_RefNannyAPIStruct;
1424 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1425 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1426 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1428 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1430 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1431 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1432 PyGILState_Release(__pyx_gilstate_save);\
1434 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1437 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1438 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1440 #define __Pyx_RefNannyFinishContext()\
1441 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1442 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1443 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1444 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1445 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1446 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1447 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1448 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1449 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1451 #define __Pyx_RefNannyDeclarations
1452 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1453 #define __Pyx_RefNannyFinishContext()
1454 #define __Pyx_INCREF(r) Py_INCREF(r)
1455 #define __Pyx_DECREF(r) Py_DECREF(r)
1456 #define __Pyx_GOTREF(r)
1457 #define __Pyx_GIVEREF(r)
1458 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1459 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1460 #define __Pyx_XGOTREF(r)
1461 #define __Pyx_XGIVEREF(r)
1463 #define __Pyx_XDECREF_SET(r, v) do {\
1464 PyObject *tmp = (PyObject *) r;\
1465 r = v; __Pyx_XDECREF(tmp);\
1467 #define __Pyx_DECREF_SET(r, v) do {\
1468 PyObject *tmp = (PyObject *) r;\
1469 r = v; __Pyx_DECREF(tmp);\
1471 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1472 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1475 #if CYTHON_USE_TYPE_SLOTS
1476 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1478 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1482 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1485 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1486 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1489 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1492 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1493 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1494 const char* function_name);
1497 #if CYTHON_USE_TYPE_SLOTS
1498 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1499 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1501 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1502 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1506 #if CYTHON_COMPILING_IN_CPYTHON
1507 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1509 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1513 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1516 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1517 #define __Pyx_MEMVIEW_DIRECT 1
1518 #define __Pyx_MEMVIEW_PTR 2
1519 #define __Pyx_MEMVIEW_FULL 4
1520 #define __Pyx_MEMVIEW_CONTIG 8
1521 #define __Pyx_MEMVIEW_STRIDED 16
1522 #define __Pyx_MEMVIEW_FOLLOW 32
1523 #define __Pyx_IS_C_CONTIG 1
1524 #define __Pyx_IS_F_CONTIG 2
1525 static int __Pyx_init_memviewslice(
1526 struct __pyx_memoryview_obj *memview,
1528 __Pyx_memviewslice *memviewslice,
1529 int memview_is_new_reference);
1530 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1531 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1532 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1533 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1534 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1535 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1536 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1537 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1538 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1539 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1542 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1543 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
1545 PyTypeObject *tp = Py_TYPE(obj);
1546 #if PY_MAJOR_VERSION < 3
1547 if (unlikely(PyInstance_Check(obj)))
1548 return __Pyx_PyObject_GetAttrStr(obj, attr_name);
1550 res = _PyType_Lookup(tp, attr_name);
1552 descrgetfunc
f = Py_TYPE(res)->tp_descr_get;
1556 res =
f(res, obj, (PyObject *)tp);
1559 PyErr_SetObject(PyExc_AttributeError, attr_name);
1564 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
1568 #if CYTHON_FAST_PYCCALL
1569 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1571 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1575 #if CYTHON_FAST_PYCALL
1576 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1577 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1578 #if 1 || PY_VERSION_HEX < 0x030600B1
1579 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1581 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1586 #if CYTHON_COMPILING_IN_CPYTHON
1587 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1591 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1594 #if CYTHON_COMPILING_IN_CPYTHON
1595 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1597 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1601 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1602 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1603 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1604 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1605 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1606 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1607 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1608 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1609 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1610 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1611 int wraparound,
int boundscheck);
1612 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1613 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1614 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1615 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1616 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1617 int wraparound,
int boundscheck);
1618 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1619 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1620 int is_list,
int wraparound,
int boundscheck);
1623 #if CYTHON_USE_TYPE_SLOTS
1624 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1626 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1630 #if !CYTHON_COMPILING_IN_PYPY
1631 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
1633 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
1634 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1638 #if CYTHON_FAST_THREAD_STATE
1639 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1640 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1641 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1643 #define __Pyx_PyThreadState_declare
1644 #define __Pyx_PyThreadState_assign
1645 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1649 #if CYTHON_FAST_THREAD_STATE
1650 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1651 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1652 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1653 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1655 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1656 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1660 #if CYTHON_FAST_THREAD_STATE
1661 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1662 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1664 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1668 #if CYTHON_FAST_THREAD_STATE
1669 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1670 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1671 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1672 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1673 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1674 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1675 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1676 #if CYTHON_COMPILING_IN_CPYTHON
1677 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1679 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1682 #define __Pyx_PyErr_Clear() PyErr_Clear()
1683 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1684 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1685 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1686 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1687 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1688 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1689 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1693 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1694 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1695 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1696 int has_cstart,
int has_cstop,
int wraparound);
1699 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1702 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1703 int lineno,
const char *filename,
1704 int full_traceback,
int nogil);
1707 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1708 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1709 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1710 (likely(PyDict_CheckExact(obj)) ?\
1711 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1713 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1714 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1718 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1721 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1724 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1727 #if CYTHON_FAST_THREAD_STATE
1728 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1729 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1731 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1735 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1736 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1737 __Pyx__ArgTypeTest(obj, type, name, exact))
1738 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1744 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1747 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1750 #if PY_MAJOR_VERSION >= 3
1751 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1753 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1757 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1760 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1761 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1763 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1764 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1766 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1769 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
1771 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1773 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
1775 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1777 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
1779 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1783 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1784 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1785 const char* encoding,
const char* errors,
1786 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
1789 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1792 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1795 #if CYTHON_FAST_THREAD_STATE
1796 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1797 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1799 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1803 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1806 #if CYTHON_COMPILING_IN_CPYTHON
1807 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1808 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1809 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1810 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1812 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1813 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1814 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1816 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1818 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1820 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1821 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1822 PyListObject*
L = (PyListObject*) list;
1823 Py_ssize_t len = Py_SIZE(list);
1824 if (likely(
L->allocated > len)) {
1826 PyList_SET_ITEM(list, len, x);
1827 Py_SIZE(list) = len+1;
1830 return PyList_Append(list, x);
1833 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1837 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
1838 #if CYTHON_COMPILING_IN_CPYTHON
1839 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
1840 if (unlikely(!none))
1845 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
1850 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1851 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1852 PyListObject*
L = (PyListObject*) list;
1853 Py_ssize_t len = Py_SIZE(list);
1854 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
1856 PyList_SET_ITEM(list, len, x);
1857 Py_SIZE(list) = len+1;
1860 return PyList_Append(list, x);
1863 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1867 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
1870 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
1873 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1876 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
1879 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1880 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1882 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1886 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1887 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1889 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1893 static int __Pyx_setup_reduce(PyObject* type_obj);
1896 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1899 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1902 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1905 #define __Pyx_CyFunction_USED 1
1906 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1907 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1908 #define __Pyx_CYFUNCTION_CCLASS 0x04
1909 #define __Pyx_CyFunction_GetClosure(f)\
1910 (((__pyx_CyFunctionObject *) (f))->func_closure)
1911 #define __Pyx_CyFunction_GetClassObj(f)\
1912 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1913 #define __Pyx_CyFunction_Defaults(type, f)\
1914 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1915 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1916 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1918 PyCFunctionObject func;
1919 #if PY_VERSION_HEX < 0x030500A0
1920 PyObject *func_weakreflist;
1922 PyObject *func_dict;
1923 PyObject *func_name;
1924 PyObject *func_qualname;
1926 PyObject *func_globals;
1927 PyObject *func_code;
1928 PyObject *func_closure;
1929 PyObject *func_classobj;
1931 int defaults_pyobjects;
1933 PyObject *defaults_tuple;
1934 PyObject *defaults_kwdict;
1935 PyObject *(*defaults_getter)(PyObject *);
1936 PyObject *func_annotations;
1937 } __pyx_CyFunctionObject;
1938 static PyTypeObject *__pyx_CyFunctionType = 0;
1939 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
1940 __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
1941 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
1942 int flags, PyObject* qualname,
1944 PyObject *module, PyObject *globals,
1946 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1949 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1951 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1953 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1955 static int __pyx_CyFunction_init(
void);
1958 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1959 #define __Pyx_SetNameInClass(ns, name, value)\
1960 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1961 #elif CYTHON_COMPILING_IN_CPYTHON
1962 #define __Pyx_SetNameInClass(ns, name, value)\
1963 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1965 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1969 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1970 PyObject *mkw, PyObject *modname, PyObject *doc);
1971 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1972 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
1975 #ifdef CYTHON_CLINE_IN_TRACEBACK
1976 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1978 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1983 PyCodeObject* code_object;
1985 } __Pyx_CodeObjectCacheEntry;
1986 struct __Pyx_CodeObjectCache {
1989 __Pyx_CodeObjectCacheEntry* entries;
1991 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1992 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1993 static PyCodeObject *__pyx_find_code_object(
int code_line);
1994 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1997 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1998 int py_line,
const char *filename);
2000 #if PY_MAJOR_VERSION < 3
2001 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2002 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2004 #define __Pyx_GetBuffer PyObject_GetBuffer
2005 #define __Pyx_ReleaseBuffer PyBuffer_Release
2011 Py_ssize_t shape, strides, suboffsets;
2012 } __Pyx_Buf_DimInfo;
2018 __Pyx_Buffer *rcbuffer;
2020 __Pyx_Buf_DimInfo diminfo[8];
2021 } __Pyx_LocalBuf_ND;
2024 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2027 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2028 __Pyx_memviewslice *slice2,
2029 int ndim,
size_t itemsize);
2032 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2035 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2038 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2039 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2040 __Pyx_BufFmt_StackElem* stack,
2041 __Pyx_TypeInfo* type);
2044 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2047 static int __Pyx_ValidateAndInit_memviewslice(
2052 __Pyx_TypeInfo *dtype,
2053 __Pyx_BufFmt_StackElem stack[],
2054 __Pyx_memviewslice *memviewslice,
2055 PyObject *original_obj);
2058 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *,
int writable_flag);
2061 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *,
int writable_flag);
2064 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
2067 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2072 #define __Pyx_CREAL(z) ((z).real())
2073 #define __Pyx_CIMAG(z) ((z).imag())
2075 #define __Pyx_CREAL(z) (__real__(z))
2076 #define __Pyx_CIMAG(z) (__imag__(z))
2079 #define __Pyx_CREAL(z) ((z).real)
2080 #define __Pyx_CIMAG(z) ((z).imag)
2082 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2083 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2084 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2085 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2087 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2088 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2093 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2094 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2095 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2096 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2097 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2098 #define __Pyx_c_neg_float(a) (-(a))
2100 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2101 #define __Pyx_c_conj_float(z) (::std::conj(z))
2103 #define __Pyx_c_abs_float(z) (::std::abs(z))
2104 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2107 #define __Pyx_c_is_zero_float(z) ((z)==0)
2108 #define __Pyx_c_conj_float(z) (conjf(z))
2110 #define __Pyx_c_abs_float(z) (cabsf(z))
2111 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2115 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2116 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2117 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2118 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2119 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2120 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2121 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2122 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2124 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2125 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2131 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2132 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2133 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2134 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2135 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2136 #define __Pyx_c_neg_double(a) (-(a))
2138 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2139 #define __Pyx_c_conj_double(z) (::std::conj(z))
2141 #define __Pyx_c_abs_double(z) (::std::abs(z))
2142 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2145 #define __Pyx_c_is_zero_double(z) ((z)==0)
2146 #define __Pyx_c_conj_double(z) (conj(z))
2148 #define __Pyx_c_abs_double(z) (cabs(z))
2149 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2153 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2154 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2155 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2156 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2157 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2158 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2159 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2160 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2162 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2163 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2168 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
2171 static __Pyx_memviewslice
2172 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2173 const char *mode,
int ndim,
2174 size_t sizeof_dtype,
int contig_flag,
2175 int dtype_is_object);
2178 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2181 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
2184 static CYTHON_INLINE
size_t __Pyx_PyInt_As_size_t(PyObject *);
2187 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2190 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2193 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2196 static int __Pyx_check_binary_version(
void);
2199 #if !defined(__Pyx_PyIdentifier_FromString)
2200 #if PY_MAJOR_VERSION < 3
2201 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
2203 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
2208 static PyObject *__Pyx_ImportModule(
const char *name);
2211 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
size_t size,
int strict);
2214 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2216 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self);
2217 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2218 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2219 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2220 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2221 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2222 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2223 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2224 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2225 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2226 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2237 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2250 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2251 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2252 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2253 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2254 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2255 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
2264 static PyTypeObject *__pyx_ptype_15superluWrappers_cSparseMatrix = 0;
2265 static PyTypeObject *__pyx_ptype_15superluWrappers_SparseFactor = 0;
2266 static PyTypeObject *__pyx_array_type = 0;
2267 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2268 static PyTypeObject *__pyx_memoryview_type = 0;
2269 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2270 static PyObject *
generic = 0;
2271 static PyObject *strided = 0;
2272 static PyObject *indirect = 0;
2273 static PyObject *contiguous = 0;
2274 static PyObject *indirect_contiguous = 0;
2275 static int __pyx_memoryview_thread_locks_used;
2276 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2277 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(
struct __pyx_obj_15superluWrappers_cSparseMatrix *, __Pyx_memviewslice, __Pyx_memviewslice);
2278 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(
struct __pyx_obj_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_15superluWrappers_SparseFactor *);
2279 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(
struct __pyx_obj_15superluWrappers_SparseFactor *, __Pyx_memviewslice);
2280 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2281 static void *__pyx_align_pointer(
void *,
size_t);
2282 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2283 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2284 static PyObject *_unellipsify(PyObject *,
int);
2285 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2286 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2287 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2288 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2289 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2290 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2291 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2292 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2293 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2294 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2295 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2296 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2297 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2298 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2299 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2300 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2301 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2302 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2303 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2304 static int __pyx_memoryview_err(PyObject *,
char *);
2305 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2306 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2307 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2308 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2309 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2310 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2311 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2312 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2313 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = {
"float64_t", NULL,
sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0,
'R', 0, 0 };
2314 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = {
"int32_t", NULL,
sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ?
'U' :
'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
2315 #define __Pyx_MODULE_NAME "superluWrappers"
2316 extern int __pyx_module_is_main_superluWrappers;
2317 int __pyx_module_is_main_superluWrappers = 0;
2320 static PyObject *__pyx_builtin_object;
2321 static PyObject *__pyx_builtin_open;
2322 static PyObject *__pyx_builtin_range;
2323 static PyObject *__pyx_builtin_TypeError;
2324 static PyObject *__pyx_builtin_ValueError;
2325 static PyObject *__pyx_builtin_RuntimeError;
2326 static PyObject *__pyx_builtin_ImportError;
2327 static PyObject *__pyx_builtin_MemoryError;
2328 static PyObject *__pyx_builtin_enumerate;
2329 static PyObject *__pyx_builtin_Ellipsis;
2330 static PyObject *__pyx_builtin_id;
2331 static PyObject *__pyx_builtin_IndexError;
2332 static const char __pyx_k_O[] =
"O";
2333 static const char __pyx_k_c[] =
"c";
2334 static const char __pyx_k_i[] =
"i";
2335 static const char __pyx_k_k[] =
"k";
2336 static const char __pyx_k_w[] =
"w";
2337 static const char __pyx_k_x[] =
"x";
2338 static const char __pyx_k_y[] =
"y";
2339 static const char __pyx_k_id[] =
"id";
2340 static const char __pyx_k_nc[] =
"nc";
2341 static const char __pyx_k_np[] =
"np";
2342 static const char __pyx_k_nr[] =
"nr";
2343 static const char __pyx_k_dim[] =
"dim";
2344 static const char __pyx_k_doc[] =
"__doc__";
2345 static const char __pyx_k_new[] =
"__new__";
2346 static const char __pyx_k_nnz[] =
"nnz";
2347 static const char __pyx_k_obj[] =
"obj";
2348 static const char __pyx_k_base[] =
"base";
2349 static const char __pyx_k_dict[] =
"__dict__";
2350 static const char __pyx_k_exit[] =
"__exit__";
2351 static const char __pyx_k_init[] =
"__init__";
2352 static const char __pyx_k_main[] =
"__main__";
2353 static const char __pyx_k_mode[] =
"mode";
2354 static const char __pyx_k_name[] =
"name";
2355 static const char __pyx_k_ndim[] =
"ndim";
2356 static const char __pyx_k_open[] =
"open";
2357 static const char __pyx_k_pack[] =
"pack";
2358 static const char __pyx_k_rows[] =
"_rows";
2359 static const char __pyx_k_self[] =
"self";
2360 static const char __pyx_k_size[] =
"size";
2361 static const char __pyx_k_step[] =
"step";
2362 static const char __pyx_k_stop[] =
"stop";
2363 static const char __pyx_k_test[] =
"__test__";
2364 static const char __pyx_k_ASCII[] =
"ASCII";
2365 static const char __pyx_k_class[] =
"__class__";
2366 static const char __pyx_k_enter[] =
"__enter__";
2367 static const char __pyx_k_error[] =
"error";
2368 static const char __pyx_k_flags[] =
"flags";
2369 static const char __pyx_k_i_i_i[] =
"%i %i %i \n";
2370 static const char __pyx_k_numpy[] =
"numpy";
2371 static const char __pyx_k_nzval[] =
"nzval";
2372 static const char __pyx_k_range[] =
"range";
2373 static const char __pyx_k_shape[] =
"shape";
2374 static const char __pyx_k_start[] =
"start";
2375 static const char __pyx_k_write[] =
"write";
2376 static const char __pyx_k_colind[] =
"colind";
2377 static const char __pyx_k_encode[] =
"encode";
2378 static const char __pyx_k_format[] =
"format";
2379 static const char __pyx_k_fwrite[] =
"fwrite";
2380 static const char __pyx_k_import[] =
"__import__";
2381 static const char __pyx_k_matvec[] =
"matvec";
2382 static const char __pyx_k_module[] =
"__module__";
2383 static const char __pyx_k_name_2[] =
"__name__";
2384 static const char __pyx_k_nzvals[] =
"nzvals";
2385 static const char __pyx_k_object[] =
"object";
2386 static const char __pyx_k_pickle[] =
"pickle";
2387 static const char __pyx_k_reduce[] =
"__reduce__";
2388 static const char __pyx_k_rowptr[] =
"rowptr";
2389 static const char __pyx_k_struct[] =
"struct";
2390 static const char __pyx_k_unpack[] =
"unpack";
2391 static const char __pyx_k_update[] =
"update";
2392 static const char __pyx_k_fortran[] =
"fortran";
2393 static const char __pyx_k_memview[] =
"memview";
2394 static const char __pyx_k_prepare[] =
"__prepare__";
2395 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2396 static const char __pyx_k_filename[] =
"filename";
2397 static const char __pyx_k_getstate[] =
"__getstate__";
2398 static const char __pyx_k_itemsize[] =
"itemsize";
2399 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2400 static const char __pyx_k_qualname[] =
"__qualname__";
2401 static const char __pyx_k_setstate[] =
"__setstate__";
2402 static const char __pyx_k_TypeError[] =
"TypeError";
2403 static const char __pyx_k_d_d_13_8e[] =
"%d %d %13.8e\n";
2404 static const char __pyx_k_enumerate[] =
"enumerate";
2405 static const char __pyx_k_metaclass[] =
"__metaclass__";
2406 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2407 static const char __pyx_k_range_end[] =
"range_end";
2408 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2409 static const char __pyx_k_IndexError[] =
"IndexError";
2410 static const char __pyx_k_ValueError[] =
"ValueError";
2411 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2412 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2413 static const char __pyx_k_ImportError[] =
"ImportError";
2414 static const char __pyx_k_MemoryError[] =
"MemoryError";
2415 static const char __pyx_k_PickleError[] =
"PickleError";
2416 static const char __pyx_k_output_file[] =
"output_file";
2417 static const char __pyx_k_range_start[] =
"range_start";
2418 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2419 static const char __pyx_k_SparseMatrix[] =
"SparseMatrix";
2420 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2421 static const char __pyx_k_sparseFactor[] =
"sparseFactor";
2422 static const char __pyx_k_stringsource[] =
"stringsource";
2423 static const char __pyx_k_cSparseMatrix[] =
"_cSparseMatrix";
2424 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2425 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2426 static const char __pyx_k_sparse_matrix[] =
"sparse_matrix";
2427 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2428 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2429 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2430 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2431 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2432 static const char __pyx_k_superluWrappers[] =
"superluWrappers";
2433 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2434 static const char __pyx_k_sparseFactorSolve[] =
"sparseFactorSolve";
2435 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2436 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2437 static const char __pyx_k_SparseMatrix___init[] =
"SparseMatrix.__init__";
2438 static const char __pyx_k_SparseMatrix_fwrite[] =
"SparseMatrix.fwrite";
2439 static const char __pyx_k_SparseMatrix_matvec[] =
"SparseMatrix.matvec";
2440 static const char __pyx_k_sparseFactorPrepare[] =
"sparseFactorPrepare";
2441 static const char __pyx_k_getCSRrepresentation[] =
"getCSRrepresentation";
2442 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2443 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2444 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2445 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2446 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2447 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2448 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2449 static const char __pyx_k_getSubMatCSRrepresentation[] =
"getSubMatCSRrepresentation";
2450 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2451 static const char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
2452 static const char __pyx_k_proteus_superluWrappers_pyx[] =
"proteus/superluWrappers.pyx";
2453 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2454 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2455 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2456 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
2457 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2458 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2459 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2460 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2461 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2462 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
2463 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] =
"Incompatible checksums (%s vs 0xb068931 = (name))";
2464 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2465 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2466 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
2467 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2468 static const char __pyx_k_SparseMatrix_getCSRrepresentatio[] =
"SparseMatrix.getCSRrepresentation";
2469 static const char __pyx_k_SparseMatrix_getSubMatCSRreprese[] =
"SparseMatrix.getSubMatCSRrepresentation";
2470 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2471 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2472 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
2473 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2474 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2475 static const char __pyx_k_self_A_self_AC_self_L_self_U_sel[] =
"self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling";
2476 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2477 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
2478 static PyObject *__pyx_n_s_ASCII;
2479 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2480 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2481 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2482 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2483 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2484 static PyObject *__pyx_n_s_Ellipsis;
2485 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2486 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2487 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2488 static PyObject *__pyx_n_s_ImportError;
2489 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2490 static PyObject *__pyx_n_s_IndexError;
2491 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2492 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2493 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2494 static PyObject *__pyx_n_s_MemoryError;
2495 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2496 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2497 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2498 static PyObject *__pyx_n_b_O;
2499 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2500 static PyObject *__pyx_n_s_PickleError;
2501 static PyObject *__pyx_n_s_RuntimeError;
2502 static PyObject *__pyx_n_s_SparseMatrix;
2503 static PyObject *__pyx_n_s_SparseMatrix___init;
2504 static PyObject *__pyx_n_s_SparseMatrix_fwrite;
2505 static PyObject *__pyx_n_s_SparseMatrix_getCSRrepresentatio;
2506 static PyObject *__pyx_n_s_SparseMatrix_getSubMatCSRreprese;
2507 static PyObject *__pyx_n_s_SparseMatrix_matvec;
2508 static PyObject *__pyx_n_s_TypeError;
2509 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2510 static PyObject *__pyx_n_s_ValueError;
2511 static PyObject *__pyx_n_s_View_MemoryView;
2512 static PyObject *__pyx_n_s_allocate_buffer;
2513 static PyObject *__pyx_n_s_base;
2514 static PyObject *__pyx_n_s_c;
2515 static PyObject *__pyx_n_u_c;
2516 static PyObject *__pyx_n_s_cSparseMatrix;
2517 static PyObject *__pyx_n_s_class;
2518 static PyObject *__pyx_n_s_cline_in_traceback;
2519 static PyObject *__pyx_n_s_colind;
2520 static PyObject *__pyx_kp_s_contiguous_and_direct;
2521 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2522 static PyObject *__pyx_kp_s_d_d_13_8e;
2523 static PyObject *__pyx_n_s_dict;
2524 static PyObject *__pyx_n_s_dim;
2525 static PyObject *__pyx_n_s_doc;
2526 static PyObject *__pyx_n_s_dtype_is_object;
2527 static PyObject *__pyx_n_s_encode;
2528 static PyObject *__pyx_n_s_enter;
2529 static PyObject *__pyx_n_s_enumerate;
2530 static PyObject *__pyx_n_s_error;
2531 static PyObject *__pyx_n_s_exit;
2532 static PyObject *__pyx_n_s_filename;
2533 static PyObject *__pyx_n_s_flags;
2534 static PyObject *__pyx_n_s_format;
2535 static PyObject *__pyx_n_s_fortran;
2536 static PyObject *__pyx_n_u_fortran;
2537 static PyObject *__pyx_n_s_fwrite;
2538 static PyObject *__pyx_n_s_getCSRrepresentation;
2539 static PyObject *__pyx_n_s_getSubMatCSRrepresentation;
2540 static PyObject *__pyx_n_s_getstate;
2541 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2542 static PyObject *__pyx_n_s_i;
2543 static PyObject *__pyx_kp_s_i_i_i;
2544 static PyObject *__pyx_n_s_id;
2545 static PyObject *__pyx_n_s_import;
2546 static PyObject *__pyx_n_s_init;
2547 static PyObject *__pyx_n_s_itemsize;
2548 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2549 static PyObject *__pyx_n_s_k;
2550 static PyObject *__pyx_n_s_main;
2551 static PyObject *__pyx_n_s_matvec;
2552 static PyObject *__pyx_n_s_memview;
2553 static PyObject *__pyx_n_s_metaclass;
2554 static PyObject *__pyx_n_s_mode;
2555 static PyObject *__pyx_n_s_module;
2556 static PyObject *__pyx_n_s_name;
2557 static PyObject *__pyx_n_s_name_2;
2558 static PyObject *__pyx_n_s_nc;
2559 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2560 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2561 static PyObject *__pyx_n_s_ndim;
2562 static PyObject *__pyx_n_s_new;
2563 static PyObject *__pyx_n_s_nnz;
2564 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2565 static PyObject *__pyx_n_s_np;
2566 static PyObject *__pyx_n_s_nr;
2567 static PyObject *__pyx_n_s_numpy;
2568 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2569 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2570 static PyObject *__pyx_n_s_nzval;
2571 static PyObject *__pyx_n_s_nzvals;
2572 static PyObject *__pyx_n_s_obj;
2573 static PyObject *__pyx_n_s_object;
2574 static PyObject *__pyx_n_s_open;
2575 static PyObject *__pyx_n_s_output_file;
2576 static PyObject *__pyx_n_s_pack;
2577 static PyObject *__pyx_n_s_pickle;
2578 static PyObject *__pyx_n_s_prepare;
2579 static PyObject *__pyx_kp_s_proteus_superluWrappers_pyx;
2580 static PyObject *__pyx_n_s_pyx_PickleError;
2581 static PyObject *__pyx_n_s_pyx_checksum;
2582 static PyObject *__pyx_n_s_pyx_getbuffer;
2583 static PyObject *__pyx_n_s_pyx_result;
2584 static PyObject *__pyx_n_s_pyx_state;
2585 static PyObject *__pyx_n_s_pyx_type;
2586 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2587 static PyObject *__pyx_n_s_pyx_vtable;
2588 static PyObject *__pyx_n_s_qualname;
2589 static PyObject *__pyx_n_s_range;
2590 static PyObject *__pyx_n_s_range_end;
2591 static PyObject *__pyx_n_s_range_start;
2592 static PyObject *__pyx_n_s_reduce;
2593 static PyObject *__pyx_n_s_reduce_cython;
2594 static PyObject *__pyx_n_s_reduce_ex;
2595 static PyObject *__pyx_n_s_rowptr;
2596 static PyObject *__pyx_n_s_rows;
2597 static PyObject *__pyx_n_s_self;
2598 static PyObject *__pyx_kp_s_self_A_self_AC_self_L_self_U_sel;
2599 static PyObject *__pyx_n_s_setstate;
2600 static PyObject *__pyx_n_s_setstate_cython;
2601 static PyObject *__pyx_n_s_shape;
2602 static PyObject *__pyx_n_s_size;
2603 static PyObject *__pyx_n_s_sparseFactor;
2604 static PyObject *__pyx_n_s_sparseFactorPrepare;
2605 static PyObject *__pyx_n_s_sparseFactorSolve;
2606 static PyObject *__pyx_n_s_sparse_matrix;
2607 static PyObject *__pyx_n_s_start;
2608 static PyObject *__pyx_n_s_step;
2609 static PyObject *__pyx_n_s_stop;
2610 static PyObject *__pyx_kp_s_strided_and_direct;
2611 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2612 static PyObject *__pyx_kp_s_strided_and_indirect;
2613 static PyObject *__pyx_kp_s_stringsource;
2614 static PyObject *__pyx_n_s_struct;
2615 static PyObject *__pyx_n_s_superluWrappers;
2616 static PyObject *__pyx_n_s_test;
2617 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2618 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2619 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2620 static PyObject *__pyx_n_s_unpack;
2621 static PyObject *__pyx_n_s_update;
2622 static PyObject *__pyx_n_s_w;
2623 static PyObject *__pyx_n_s_write;
2624 static PyObject *__pyx_n_s_x;
2625 static PyObject *__pyx_n_s_y;
2626 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr);
2627 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y);
2628 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base);
2629 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self);
2630 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end);
2631 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self,
int __pyx_v_nr,
int __pyx_v_nc,
int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr);
2632 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self);
2633 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2634 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim);
2635 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self);
2636 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value);
2637 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self);
2638 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2639 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor);
2640 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x);
2641 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2642 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
2643 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2644 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2645 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2646 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2647 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2648 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2649 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2650 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2651 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2652 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2653 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2654 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2655 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2656 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2657 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2658 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2659 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2660 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2661 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2662 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2663 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2664 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2665 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2666 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2667 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2668 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2669 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2670 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2671 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2672 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2673 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2674 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2675 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2676 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2677 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2678 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2679 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2680 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2681 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2682 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2683 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2684 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2685 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k);
2686 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2687 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2688 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2689 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2690 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2691 static PyObject *__pyx_int_0;
2692 static PyObject *__pyx_int_1;
2693 static PyObject *__pyx_int_184977713;
2694 static PyObject *__pyx_int_neg_1;
2695 static PyObject *__pyx_tuple_;
2696 static PyObject *__pyx_tuple__2;
2697 static PyObject *__pyx_tuple__3;
2698 static PyObject *__pyx_tuple__4;
2699 static PyObject *__pyx_tuple__5;
2700 static PyObject *__pyx_tuple__6;
2701 static PyObject *__pyx_tuple__7;
2702 static PyObject *__pyx_tuple__8;
2703 static PyObject *__pyx_tuple__9;
2704 static PyObject *__pyx_slice__30;
2705 static PyObject *__pyx_slice__31;
2706 static PyObject *__pyx_slice__32;
2707 static PyObject *__pyx_tuple__10;
2708 static PyObject *__pyx_tuple__11;
2709 static PyObject *__pyx_tuple__12;
2710 static PyObject *__pyx_tuple__13;
2711 static PyObject *__pyx_tuple__14;
2712 static PyObject *__pyx_tuple__15;
2713 static PyObject *__pyx_tuple__16;
2714 static PyObject *__pyx_tuple__17;
2715 static PyObject *__pyx_tuple__18;
2716 static PyObject *__pyx_tuple__19;
2717 static PyObject *__pyx_tuple__20;
2718 static PyObject *__pyx_tuple__21;
2719 static PyObject *__pyx_tuple__22;
2720 static PyObject *__pyx_tuple__23;
2721 static PyObject *__pyx_tuple__24;
2722 static PyObject *__pyx_tuple__25;
2723 static PyObject *__pyx_tuple__26;
2724 static PyObject *__pyx_tuple__27;
2725 static PyObject *__pyx_tuple__28;
2726 static PyObject *__pyx_tuple__29;
2727 static PyObject *__pyx_tuple__33;
2728 static PyObject *__pyx_tuple__34;
2729 static PyObject *__pyx_tuple__35;
2730 static PyObject *__pyx_tuple__36;
2731 static PyObject *__pyx_tuple__37;
2732 static PyObject *__pyx_tuple__39;
2733 static PyObject *__pyx_tuple__41;
2734 static PyObject *__pyx_tuple__43;
2735 static PyObject *__pyx_tuple__45;
2736 static PyObject *__pyx_tuple__47;
2737 static PyObject *__pyx_tuple__49;
2738 static PyObject *__pyx_tuple__51;
2739 static PyObject *__pyx_tuple__52;
2740 static PyObject *__pyx_tuple__53;
2741 static PyObject *__pyx_tuple__54;
2742 static PyObject *__pyx_tuple__55;
2743 static PyObject *__pyx_tuple__56;
2744 static PyObject *__pyx_codeobj__38;
2745 static PyObject *__pyx_codeobj__40;
2746 static PyObject *__pyx_codeobj__42;
2747 static PyObject *__pyx_codeobj__44;
2748 static PyObject *__pyx_codeobj__46;
2749 static PyObject *__pyx_codeobj__48;
2750 static PyObject *__pyx_codeobj__50;
2751 static PyObject *__pyx_codeobj__57;
2763 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2764 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_1__init__ = {
"__init__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2765 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2766 PyObject *__pyx_v_self = 0;
2767 PyObject *__pyx_v_nr = 0;
2768 PyObject *__pyx_v_nc = 0;
2769 PyObject *__pyx_v_nnz = 0;
2770 PyObject *__pyx_v_nzvals = 0;
2771 PyObject *__pyx_v_colind = 0;
2772 PyObject *__pyx_v_rowptr = 0;
2773 PyObject *__pyx_r = 0;
2774 __Pyx_RefNannyDeclarations
2775 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
2777 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzvals,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
2778 PyObject* values[7] = {0,0,0,0,0,0,0};
2779 if (unlikely(__pyx_kwds)) {
2781 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2783 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2785 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2787 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2789 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2791 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2793 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2795 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2798 default:
goto __pyx_L5_argtuple_error;
2800 kw_args = PyDict_Size(__pyx_kwds);
2803 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2804 else goto __pyx_L5_argtuple_error;
2807 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
2809 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 1); __PYX_ERR(0, 15, __pyx_L3_error)
2813 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
2815 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 2); __PYX_ERR(0, 15, __pyx_L3_error)
2819 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
2821 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 3); __PYX_ERR(0, 15, __pyx_L3_error)
2825 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzvals)) != 0)) kw_args--;
2827 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 4); __PYX_ERR(0, 15, __pyx_L3_error)
2831 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
2833 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 5); __PYX_ERR(0, 15, __pyx_L3_error)
2837 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
2839 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, 6); __PYX_ERR(0, 15, __pyx_L3_error)
2842 if (unlikely(kw_args > 0)) {
2843 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 15, __pyx_L3_error)
2845 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
2846 goto __pyx_L5_argtuple_error;
2848 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2849 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2850 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2851 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2852 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2853 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2854 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2856 __pyx_v_self = values[0];
2857 __pyx_v_nr = values[1];
2858 __pyx_v_nc = values[2];
2859 __pyx_v_nnz = values[3];
2860 __pyx_v_nzvals = values[4];
2861 __pyx_v_colind = values[5];
2862 __pyx_v_rowptr = values[6];
2864 goto __pyx_L4_argument_unpacking_done;
2865 __pyx_L5_argtuple_error:;
2866 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 15, __pyx_L3_error)
2868 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2869 __Pyx_RefNannyFinishContext();
2871 __pyx_L4_argument_unpacking_done:;
2872 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix___init__(__pyx_self, __pyx_v_self, __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzvals, __pyx_v_colind, __pyx_v_rowptr);
2875 __Pyx_RefNannyFinishContext();
2879 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr) {
2880 PyObject *__pyx_r = NULL;
2881 __Pyx_RefNannyDeclarations
2882 PyObject *__pyx_t_1 = NULL;
2883 PyObject *__pyx_t_2 = NULL;
2884 PyObject *__pyx_t_3 = NULL;
2885 PyObject *__pyx_t_4 = NULL;
2886 __Pyx_RefNannySetupContext(
"__init__", 0);
2895 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nr, __pyx_v_nr) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
2896 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc, __pyx_v_nc) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
2905 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nnz, __pyx_v_nnz) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
2914 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
2915 __Pyx_GOTREF(__pyx_t_1);
2916 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
2917 __Pyx_GOTREF(__pyx_t_2);
2918 __pyx_t_3 = PyList_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
2919 __Pyx_GOTREF(__pyx_t_3);
2920 __Pyx_GIVEREF(__pyx_t_1);
2921 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
2922 __Pyx_GIVEREF(__pyx_t_2);
2923 PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
2926 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
2927 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2936 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nzvals, __pyx_v_nzvals) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
2945 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_colind, __pyx_v_colind) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
2954 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rowptr, __pyx_v_rowptr) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
2963 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
2964 __Pyx_GOTREF(__pyx_t_3);
2973 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
2974 __Pyx_GOTREF(__pyx_t_2);
2983 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
2984 __Pyx_GOTREF(__pyx_t_1);
2993 __pyx_t_4 = PyTuple_New(6);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
2994 __Pyx_GOTREF(__pyx_t_4);
2995 __Pyx_INCREF(__pyx_v_nr);
2996 __Pyx_GIVEREF(__pyx_v_nr);
2997 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nr);
2998 __Pyx_INCREF(__pyx_v_nc);
2999 __Pyx_GIVEREF(__pyx_v_nc);
3000 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_nc);
3001 __Pyx_INCREF(__pyx_v_nnz);
3002 __Pyx_GIVEREF(__pyx_v_nnz);
3003 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nnz);
3004 __Pyx_GIVEREF(__pyx_t_3);
3005 PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
3006 __Pyx_GIVEREF(__pyx_t_2);
3007 PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2);
3008 __Pyx_GIVEREF(__pyx_t_1);
3009 PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1);
3013 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_15superluWrappers_cSparseMatrix), __pyx_t_4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
3014 __Pyx_GOTREF(__pyx_t_1);
3015 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3016 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3017 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3028 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3031 __Pyx_XDECREF(__pyx_t_1);
3032 __Pyx_XDECREF(__pyx_t_2);
3033 __Pyx_XDECREF(__pyx_t_3);
3034 __Pyx_XDECREF(__pyx_t_4);
3035 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3038 __Pyx_XGIVEREF(__pyx_r);
3039 __Pyx_RefNannyFinishContext();
3052 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3053 static char __pyx_doc_15superluWrappers_12SparseMatrix_2matvec[] =
"\n Compute the sparse matrix-vector product y = Ax\n\n Arguments\n ---------\n x (input) : numpy array\n y (output) : numpy array\n ";
3054 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_3matvec = {
"matvec", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_3matvec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_2matvec};
3055 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3056 PyObject *__pyx_v_self = 0;
3057 PyObject *__pyx_v_x = 0;
3058 PyObject *__pyx_v_y = 0;
3059 PyObject *__pyx_r = 0;
3060 __Pyx_RefNannyDeclarations
3061 __Pyx_RefNannySetupContext(
"matvec (wrapper)", 0);
3063 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,0};
3064 PyObject* values[3] = {0,0,0};
3065 if (unlikely(__pyx_kwds)) {
3067 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3069 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3071 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3073 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3076 default:
goto __pyx_L5_argtuple_error;
3078 kw_args = PyDict_Size(__pyx_kwds);
3081 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3082 else goto __pyx_L5_argtuple_error;
3085 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3087 __Pyx_RaiseArgtupleInvalid(
"matvec", 1, 3, 3, 1); __PYX_ERR(0, 35, __pyx_L3_error)
3091 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3093 __Pyx_RaiseArgtupleInvalid(
"matvec", 1, 3, 3, 2); __PYX_ERR(0, 35, __pyx_L3_error)
3096 if (unlikely(kw_args > 0)) {
3097 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"matvec") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
3099 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3100 goto __pyx_L5_argtuple_error;
3102 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3103 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3104 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3106 __pyx_v_self = values[0];
3107 __pyx_v_x = values[1];
3108 __pyx_v_y = values[2];
3110 goto __pyx_L4_argument_unpacking_done;
3111 __pyx_L5_argtuple_error:;
3112 __Pyx_RaiseArgtupleInvalid(
"matvec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error)
3114 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3115 __Pyx_RefNannyFinishContext();
3117 __pyx_L4_argument_unpacking_done:;
3118 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_2matvec(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);
3121 __Pyx_RefNannyFinishContext();
3125 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
3126 PyObject *__pyx_r = NULL;
3127 __Pyx_RefNannyDeclarations
3128 PyObject *__pyx_t_1 = NULL;
3129 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
3130 __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
3131 __Pyx_RefNannySetupContext(
"matvec", 0);
3140 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
3141 __Pyx_GOTREF(__pyx_t_1);
3142 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 44, __pyx_L1_error)
3143 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3144 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_y, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3145 __pyx_f_15superluWrappers_SparseMatrix_matvec(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3);
3146 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3147 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3148 __pyx_t_2.memview = NULL;
3149 __pyx_t_2.data = NULL;
3150 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3151 __pyx_t_3.memview = NULL;
3152 __pyx_t_3.data = NULL;
3163 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3166 __Pyx_XDECREF(__pyx_t_1);
3167 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3168 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3169 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3172 __Pyx_XGIVEREF(__pyx_r);
3173 __Pyx_RefNannyFinishContext();
3186 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3187 static char __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite[] =
" Write the sparse matrix to a file\n\n Arguments\n ---------\n filename : str\n The output filename\n base : int\n ?!Possibly something to do with parallel?!\n ";
3188 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite = {
"fwrite", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite};
3189 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3190 PyObject *__pyx_v_self = 0;
3191 PyObject *__pyx_v_filename = 0;
3192 PyObject *__pyx_v_base = 0;
3193 PyObject *__pyx_r = 0;
3194 __Pyx_RefNannyDeclarations
3195 __Pyx_RefNannySetupContext(
"fwrite (wrapper)", 0);
3197 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,&__pyx_n_s_base,0};
3198 PyObject* values[3] = {0,0,0};
3199 if (unlikely(__pyx_kwds)) {
3201 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3203 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3205 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3207 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3210 default:
goto __pyx_L5_argtuple_error;
3212 kw_args = PyDict_Size(__pyx_kwds);
3215 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3216 else goto __pyx_L5_argtuple_error;
3219 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
3221 __Pyx_RaiseArgtupleInvalid(
"fwrite", 1, 3, 3, 1); __PYX_ERR(0, 46, __pyx_L3_error)
3225 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
3227 __Pyx_RaiseArgtupleInvalid(
"fwrite", 1, 3, 3, 2); __PYX_ERR(0, 46, __pyx_L3_error)
3230 if (unlikely(kw_args > 0)) {
3231 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"fwrite") < 0)) __PYX_ERR(0, 46, __pyx_L3_error)
3233 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3234 goto __pyx_L5_argtuple_error;
3236 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3237 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3238 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3240 __pyx_v_self = values[0];
3241 __pyx_v_filename = values[1];
3242 __pyx_v_base = values[2];
3244 goto __pyx_L4_argument_unpacking_done;
3245 __pyx_L5_argtuple_error:;
3246 __Pyx_RaiseArgtupleInvalid(
"fwrite", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 46, __pyx_L3_error)
3248 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3249 __Pyx_RefNannyFinishContext();
3251 __pyx_L4_argument_unpacking_done:;
3252 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(__pyx_self, __pyx_v_self, __pyx_v_filename, __pyx_v_base);
3255 __Pyx_RefNannyFinishContext();
3259 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base) {
3260 PyObject *__pyx_v_output_file = NULL;
3261 PyObject *__pyx_v_i = NULL;
3262 PyObject *__pyx_v_k = NULL;
3263 PyObject *__pyx_r = NULL;
3264 __Pyx_RefNannyDeclarations
3265 PyObject *__pyx_t_1 = NULL;
3266 PyObject *__pyx_t_2 = NULL;
3267 PyObject *__pyx_t_3 = NULL;
3268 PyObject *__pyx_t_4 = NULL;
3269 PyObject *__pyx_t_5 = NULL;
3270 PyObject *__pyx_t_6 = NULL;
3271 PyObject *__pyx_t_7 = NULL;
3272 PyObject *__pyx_t_8 = NULL;
3273 PyObject *__pyx_t_9 = NULL;
3274 PyObject *__pyx_t_10 = NULL;
3275 PyObject *__pyx_t_11 = NULL;
3276 Py_ssize_t __pyx_t_12;
3277 PyObject *(*__pyx_t_13)(PyObject *);
3278 Py_ssize_t __pyx_t_14;
3279 PyObject *(*__pyx_t_15)(PyObject *);
3280 PyObject *__pyx_t_16 = NULL;
3281 PyObject *__pyx_t_17 = NULL;
3284 __Pyx_RefNannySetupContext(
"fwrite", 0);
3294 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
3295 __Pyx_GOTREF(__pyx_t_1);
3296 __Pyx_INCREF(__pyx_v_filename);
3297 __Pyx_GIVEREF(__pyx_v_filename);
3298 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
3299 __Pyx_INCREF(__pyx_n_s_w);
3300 __Pyx_GIVEREF(__pyx_n_s_w);
3301 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_w);
3302 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
3303 __Pyx_GOTREF(__pyx_t_2);
3304 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3305 __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
3306 __Pyx_GOTREF(__pyx_t_3);
3307 __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L3_error)
3308 __Pyx_GOTREF(__pyx_t_4);
3310 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3311 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3312 if (likely(__pyx_t_5)) {
3313 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
3314 __Pyx_INCREF(__pyx_t_5);
3315 __Pyx_INCREF(
function);
3316 __Pyx_DECREF_SET(__pyx_t_4,
function);
3320 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L3_error)
3321 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3323 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L3_error)
3325 __Pyx_GOTREF(__pyx_t_1);
3326 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3327 __pyx_t_4 = __pyx_t_1;
3329 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3332 __Pyx_PyThreadState_declare
3333 __Pyx_PyThreadState_assign
3334 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3335 __Pyx_XGOTREF(__pyx_t_6);
3336 __Pyx_XGOTREF(__pyx_t_7);
3337 __Pyx_XGOTREF(__pyx_t_8);
3339 __pyx_v_output_file = __pyx_t_4;
3349 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L7_error)
3350 __Pyx_GOTREF(__pyx_t_2);
3351 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L7_error)
3352 __Pyx_GOTREF(__pyx_t_1);
3353 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L7_error)
3354 __Pyx_GOTREF(__pyx_t_5);
3355 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L7_error)
3356 __Pyx_GOTREF(__pyx_t_9);
3357 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3358 __Pyx_GOTREF(__pyx_t_10);
3359 __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_10);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3360 __Pyx_GOTREF(__pyx_t_11);
3361 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3362 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3363 __pyx_t_10 = PyTuple_New(3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3364 __Pyx_GOTREF(__pyx_t_10);
3365 __Pyx_GIVEREF(__pyx_t_1);
3366 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
3367 __Pyx_GIVEREF(__pyx_t_5);
3368 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
3369 __Pyx_GIVEREF(__pyx_t_11);
3370 PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_11);
3374 __pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_i_i_i, __pyx_t_10);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3375 __Pyx_GOTREF(__pyx_t_11);
3376 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3378 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3379 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
3380 if (likely(__pyx_t_10)) {
3381 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3382 __Pyx_INCREF(__pyx_t_10);
3383 __Pyx_INCREF(
function);
3384 __Pyx_DECREF_SET(__pyx_t_2,
function);
3388 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3389 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3390 __Pyx_GOTREF(__pyx_t_4);
3392 #if CYTHON_FAST_PYCALL
3393 if (PyFunction_Check(__pyx_t_2)) {
3394 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_11};
3395 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3396 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3397 __Pyx_GOTREF(__pyx_t_4);
3398 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3401 #if CYTHON_FAST_PYCCALL
3402 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
3403 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_11};
3404 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3405 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3406 __Pyx_GOTREF(__pyx_t_4);
3407 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3411 __pyx_t_5 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L7_error)
3412 __Pyx_GOTREF(__pyx_t_5);
3413 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __pyx_t_10 = NULL;
3414 __Pyx_GIVEREF(__pyx_t_11);
3415 PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_11);
3417 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3418 __Pyx_GOTREF(__pyx_t_4);
3419 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3422 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3423 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3432 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3433 __Pyx_GOTREF(__pyx_t_4);
3434 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3435 __Pyx_GOTREF(__pyx_t_2);
3436 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3437 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
3438 __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0;
3441 __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3442 __Pyx_GOTREF(__pyx_t_4);
3443 __pyx_t_13 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 58, __pyx_L7_error)
3445 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3447 if (likely(!__pyx_t_13)) {
3448 if (likely(PyList_CheckExact(__pyx_t_4))) {
3449 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4))
break;
3450 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3451 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3453 __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3454 __Pyx_GOTREF(__pyx_t_2);
3457 if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
3458 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3459 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3461 __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3462 __Pyx_GOTREF(__pyx_t_2);
3466 __pyx_t_2 = __pyx_t_13(__pyx_t_4);
3467 if (unlikely(!__pyx_t_2)) {
3468 PyObject* exc_type = PyErr_Occurred();
3470 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3471 else __PYX_ERR(0, 58, __pyx_L7_error)
3475 __Pyx_GOTREF(__pyx_t_2);
3477 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
3487 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3488 __Pyx_GOTREF(__pyx_t_2);
3489 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_i);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3490 __Pyx_GOTREF(__pyx_t_5);
3491 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3492 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3493 __Pyx_GOTREF(__pyx_t_2);
3494 __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
3495 __Pyx_GOTREF(__pyx_t_11);
3496 __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_11);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3497 __Pyx_GOTREF(__pyx_t_10);
3498 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3499 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3500 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
3501 __Pyx_GOTREF(__pyx_t_11);
3502 __Pyx_GIVEREF(__pyx_t_5);
3503 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5);
3504 __Pyx_GIVEREF(__pyx_t_10);
3505 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
3508 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_11, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3509 __Pyx_GOTREF(__pyx_t_10);
3510 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3511 if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
3512 __pyx_t_11 = __pyx_t_10; __Pyx_INCREF(__pyx_t_11); __pyx_t_14 = 0;
3515 __pyx_t_14 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_10);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
3516 __Pyx_GOTREF(__pyx_t_11);
3517 __pyx_t_15 = Py_TYPE(__pyx_t_11)->tp_iternext;
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 59, __pyx_L7_error)
3519 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3521 if (likely(!__pyx_t_15)) {
3522 if (likely(PyList_CheckExact(__pyx_t_11))) {
3523 if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_11))
break;
3524 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3525 __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3527 __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_14); __pyx_t_14++;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3528 __Pyx_GOTREF(__pyx_t_10);
3531 if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_11))
break;
3532 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3533 __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++;
if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3535 __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_14); __pyx_t_14++;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3536 __Pyx_GOTREF(__pyx_t_10);
3540 __pyx_t_10 = __pyx_t_15(__pyx_t_11);
3541 if (unlikely(!__pyx_t_10)) {
3542 PyObject* exc_type = PyErr_Occurred();
3544 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3545 else __PYX_ERR(0, 59, __pyx_L7_error)
3549 __Pyx_GOTREF(__pyx_t_10);
3551 __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_10);
3561 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L7_error)
3562 __Pyx_GOTREF(__pyx_t_5);
3563 __pyx_t_2 = PyNumber_Add(__pyx_v_i, __pyx_v_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L7_error)
3564 __Pyx_GOTREF(__pyx_t_2);
3565 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3566 __Pyx_GOTREF(__pyx_t_1);
3567 __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_k);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3568 __Pyx_GOTREF(__pyx_t_9);
3569 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3570 __pyx_t_1 = PyNumber_Add(__pyx_t_9, __pyx_v_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3571 __Pyx_GOTREF(__pyx_t_1);
3572 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3573 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3574 __Pyx_GOTREF(__pyx_t_9);
3575 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3576 __Pyx_GOTREF(__pyx_t_16);
3577 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3578 __pyx_t_9 = PyTuple_New(3);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3579 __Pyx_GOTREF(__pyx_t_9);
3580 __Pyx_GIVEREF(__pyx_t_2);
3581 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
3582 __Pyx_GIVEREF(__pyx_t_1);
3583 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
3584 __Pyx_GIVEREF(__pyx_t_16);
3585 PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_16);
3589 __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_d_d_13_8e, __pyx_t_9);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3590 __Pyx_GOTREF(__pyx_t_16);
3591 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3593 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
3594 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
3595 if (likely(__pyx_t_9)) {
3596 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
3597 __Pyx_INCREF(__pyx_t_9);
3598 __Pyx_INCREF(
function);
3599 __Pyx_DECREF_SET(__pyx_t_5,
function);
3603 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_16);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L7_error)
3604 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3605 __Pyx_GOTREF(__pyx_t_10);
3607 #if CYTHON_FAST_PYCALL
3608 if (PyFunction_Check(__pyx_t_5)) {
3609 PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_16};
3610 __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L7_error)
3611 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3612 __Pyx_GOTREF(__pyx_t_10);
3613 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3616 #if CYTHON_FAST_PYCCALL
3617 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
3618 PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_16};
3619 __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L7_error)
3620 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3621 __Pyx_GOTREF(__pyx_t_10);
3622 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3626 __pyx_t_1 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3627 __Pyx_GOTREF(__pyx_t_1);
3628 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL;
3629 __Pyx_GIVEREF(__pyx_t_16);
3630 PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_16);
3632 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L7_error)
3633 __Pyx_GOTREF(__pyx_t_10);
3634 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3637 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3638 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3648 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3658 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3668 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3669 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3670 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3671 goto __pyx_L12_try_end;
3673 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3674 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3675 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3676 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3677 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3678 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3679 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
3680 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3682 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3683 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_11, &__pyx_t_10) < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3684 __Pyx_GOTREF(__pyx_t_4);
3685 __Pyx_GOTREF(__pyx_t_11);
3686 __Pyx_GOTREF(__pyx_t_10);
3687 __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_11, __pyx_t_10);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3688 __Pyx_GOTREF(__pyx_t_5);
3689 __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
3690 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3691 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3692 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3693 __Pyx_GOTREF(__pyx_t_17);
3694 __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_17);
3695 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3696 if (__pyx_t_18 < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3697 __pyx_t_19 = ((!(__pyx_t_18 != 0)) != 0);
3699 __Pyx_GIVEREF(__pyx_t_4);
3700 __Pyx_GIVEREF(__pyx_t_11);
3701 __Pyx_XGIVEREF(__pyx_t_10);
3702 __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_11, __pyx_t_10);
3703 __pyx_t_4 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0;
3704 __PYX_ERR(0, 56, __pyx_L9_except_error)
3706 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3707 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3708 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3709 goto __pyx_L8_exception_handled;
3711 __pyx_L9_except_error:;
3712 __Pyx_XGIVEREF(__pyx_t_6);
3713 __Pyx_XGIVEREF(__pyx_t_7);
3714 __Pyx_XGIVEREF(__pyx_t_8);
3715 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3716 goto __pyx_L1_error;
3717 __pyx_L8_exception_handled:;
3718 __Pyx_XGIVEREF(__pyx_t_6);
3719 __Pyx_XGIVEREF(__pyx_t_7);
3720 __Pyx_XGIVEREF(__pyx_t_8);
3721 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3728 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL);
3729 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3730 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L1_error)
3731 __Pyx_GOTREF(__pyx_t_8);
3732 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3740 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3741 goto __pyx_L1_error;
3754 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3757 __Pyx_XDECREF(__pyx_t_1);
3758 __Pyx_XDECREF(__pyx_t_2);
3759 __Pyx_XDECREF(__pyx_t_4);
3760 __Pyx_XDECREF(__pyx_t_5);
3761 __Pyx_XDECREF(__pyx_t_9);
3762 __Pyx_XDECREF(__pyx_t_10);
3763 __Pyx_XDECREF(__pyx_t_11);
3764 __Pyx_XDECREF(__pyx_t_16);
3765 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3768 __Pyx_XDECREF(__pyx_v_output_file);
3769 __Pyx_XDECREF(__pyx_v_i);
3770 __Pyx_XDECREF(__pyx_v_k);
3771 __Pyx_XGIVEREF(__pyx_r);
3772 __Pyx_RefNannyFinishContext();
3785 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self);
3786 static char __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation[] =
" Get the CSR representation of the sparse matrix.\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colptr, vals)\n ";
3787 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation = {
"getCSRrepresentation", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation, METH_O, __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation};
3788 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3789 PyObject *__pyx_r = 0;
3790 __Pyx_RefNannyDeclarations
3791 __Pyx_RefNannySetupContext(
"getCSRrepresentation (wrapper)", 0);
3792 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(__pyx_self, ((PyObject *)__pyx_v_self));
3795 __Pyx_RefNannyFinishContext();
3799 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
3800 PyObject *__pyx_r = NULL;
3801 __Pyx_RefNannyDeclarations
3802 PyObject *__pyx_t_1 = NULL;
3803 PyObject *__pyx_t_2 = NULL;
3804 PyObject *__pyx_t_3 = NULL;
3805 PyObject *__pyx_t_4 = NULL;
3806 __Pyx_RefNannySetupContext(
"getCSRrepresentation", 0);
3815 __Pyx_XDECREF(__pyx_r);
3816 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
3817 __Pyx_GOTREF(__pyx_t_1);
3818 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
3819 __Pyx_GOTREF(__pyx_t_2);
3820 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
3821 __Pyx_GOTREF(__pyx_t_3);
3822 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
3823 __Pyx_GOTREF(__pyx_t_4);
3824 __Pyx_GIVEREF(__pyx_t_1);
3825 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3826 __Pyx_GIVEREF(__pyx_t_2);
3827 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
3828 __Pyx_GIVEREF(__pyx_t_3);
3829 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
3833 __pyx_r = __pyx_t_4;
3847 __Pyx_XDECREF(__pyx_t_1);
3848 __Pyx_XDECREF(__pyx_t_2);
3849 __Pyx_XDECREF(__pyx_t_3);
3850 __Pyx_XDECREF(__pyx_t_4);
3851 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.getCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
3854 __Pyx_XGIVEREF(__pyx_r);
3855 __Pyx_RefNannyFinishContext();
3868 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3869 static char __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation[] =
" Get the CSR representation for a submatrix.\n\n Arguments\n ---------\n range_start : int\n range_end : int\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colind, nzvals)\n ";
3870 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation = {
"getSubMatCSRrepresentation", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation};
3871 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3872 PyObject *__pyx_v_self = 0;
3873 PyObject *__pyx_v_range_start = 0;
3874 PyObject *__pyx_v_range_end = 0;
3875 PyObject *__pyx_r = 0;
3876 __Pyx_RefNannyDeclarations
3877 __Pyx_RefNannySetupContext(
"getSubMatCSRrepresentation (wrapper)", 0);
3879 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_range_start,&__pyx_n_s_range_end,0};
3880 PyObject* values[3] = {0,0,0};
3881 if (unlikely(__pyx_kwds)) {
3883 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3885 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3887 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3889 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3892 default:
goto __pyx_L5_argtuple_error;
3894 kw_args = PyDict_Size(__pyx_kwds);
3897 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3898 else goto __pyx_L5_argtuple_error;
3901 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_start)) != 0)) kw_args--;
3903 __Pyx_RaiseArgtupleInvalid(
"getSubMatCSRrepresentation", 1, 3, 3, 1); __PYX_ERR(0, 72, __pyx_L3_error)
3907 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_end)) != 0)) kw_args--;
3909 __Pyx_RaiseArgtupleInvalid(
"getSubMatCSRrepresentation", 1, 3, 3, 2); __PYX_ERR(0, 72, __pyx_L3_error)
3912 if (unlikely(kw_args > 0)) {
3913 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getSubMatCSRrepresentation") < 0)) __PYX_ERR(0, 72, __pyx_L3_error)
3915 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3916 goto __pyx_L5_argtuple_error;
3918 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3919 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3920 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3922 __pyx_v_self = values[0];
3923 __pyx_v_range_start = values[1];
3924 __pyx_v_range_end = values[2];
3926 goto __pyx_L4_argument_unpacking_done;
3927 __pyx_L5_argtuple_error:;
3928 __Pyx_RaiseArgtupleInvalid(
"getSubMatCSRrepresentation", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error)
3930 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
3931 __Pyx_RefNannyFinishContext();
3933 __pyx_L4_argument_unpacking_done:;
3934 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(__pyx_self, __pyx_v_self, __pyx_v_range_start, __pyx_v_range_end);
3937 __Pyx_RefNannyFinishContext();
3941 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end) {
3942 PyObject *__pyx_v__rows = NULL;
3943 PyObject *__pyx_v_nnz = NULL;
3944 PyObject *__pyx_v_rowptr = NULL;
3945 PyObject *__pyx_v_colind = NULL;
3946 PyObject *__pyx_v_nzvals = NULL;
3947 PyObject *__pyx_r = NULL;
3948 __Pyx_RefNannyDeclarations
3949 PyObject *__pyx_t_1 = NULL;
3951 PyObject *__pyx_t_3 = NULL;
3952 PyObject *__pyx_t_4 = NULL;
3953 PyObject *__pyx_t_5 = NULL;
3954 __Pyx_RefNannySetupContext(
"getSubMatCSRrepresentation", 0);
3963 #ifndef CYTHON_WITHOUT_ASSERTIONS
3964 if (unlikely(!Py_OptimizeFlag)) {
3965 __pyx_t_1 = PyObject_RichCompare(__pyx_v_range_start, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
3966 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
3967 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3968 if (unlikely(!__pyx_t_2)) {
3969 PyErr_SetNone(PyExc_AssertionError);
3970 __PYX_ERR(0, 87, __pyx_L1_error)
3974 #ifndef CYTHON_WITHOUT_ASSERTIONS
3975 if (unlikely(!Py_OptimizeFlag)) {
3976 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
3977 __Pyx_GOTREF(__pyx_t_1);
3978 __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
3979 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3980 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
3981 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3982 if (unlikely(!__pyx_t_2)) {
3983 PyErr_SetNone(PyExc_AssertionError);
3984 __PYX_ERR(0, 87, __pyx_L1_error)
3996 #ifndef CYTHON_WITHOUT_ASSERTIONS
3997 if (unlikely(!Py_OptimizeFlag)) {
3998 __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_v_range_start, Py_GT); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
3999 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 88, __pyx_L1_error)
4000 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4001 if (unlikely(!__pyx_t_2)) {
4002 PyErr_SetNone(PyExc_AssertionError);
4003 __PYX_ERR(0, 88, __pyx_L1_error)
4015 __pyx_t_3 = PyNumber_Subtract(__pyx_v_range_end, __pyx_v_range_start);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
4016 __Pyx_GOTREF(__pyx_t_3);
4017 __pyx_v__rows = __pyx_t_3;
4027 #ifndef CYTHON_WITHOUT_ASSERTIONS
4028 if (unlikely(!Py_OptimizeFlag)) {
4029 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
4030 __Pyx_GOTREF(__pyx_t_3);
4031 __pyx_t_1 = PyObject_RichCompare(__pyx_v__rows, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
4032 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4033 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 90, __pyx_L1_error)
4034 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4035 if (unlikely(!__pyx_t_2)) {
4036 PyErr_SetNone(PyExc_AssertionError);
4037 __PYX_ERR(0, 90, __pyx_L1_error)
4049 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4050 __Pyx_GOTREF(__pyx_t_1);
4051 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_end);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
4052 __Pyx_GOTREF(__pyx_t_3);
4053 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4054 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4055 __Pyx_GOTREF(__pyx_t_1);
4056 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_start);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
4057 __Pyx_GOTREF(__pyx_t_4);
4058 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4059 __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4060 __Pyx_GOTREF(__pyx_t_1);
4061 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4062 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4063 __pyx_v_nnz = __pyx_t_1;
4073 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
4074 __Pyx_GOTREF(__pyx_t_1);
4075 __pyx_t_4 = PyNumber_Add(__pyx_v_range_start, __pyx_v__rows);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4076 __Pyx_GOTREF(__pyx_t_4);
4077 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
4078 __Pyx_GOTREF(__pyx_t_3);
4079 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4080 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, &__pyx_v_range_start, &__pyx_t_3, NULL, 0, 0, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4081 __Pyx_GOTREF(__pyx_t_4);
4082 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4083 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4084 __pyx_v_rowptr = __pyx_t_4;
4094 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
4095 __Pyx_GOTREF(__pyx_t_4);
4096 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4097 __Pyx_GOTREF(__pyx_t_3);
4098 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
4099 __Pyx_GOTREF(__pyx_t_1);
4100 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4101 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4102 __Pyx_GOTREF(__pyx_t_3);
4103 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4104 __Pyx_GOTREF(__pyx_t_5);
4105 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4106 __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_nnz);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4107 __Pyx_GOTREF(__pyx_t_3);
4108 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4109 __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4110 __Pyx_GOTREF(__pyx_t_5);
4111 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4112 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4113 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4114 __pyx_v_colind = __pyx_t_5;
4124 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
4125 __Pyx_GOTREF(__pyx_t_5);
4126 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4127 __Pyx_GOTREF(__pyx_t_3);
4128 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
4129 __Pyx_GOTREF(__pyx_t_1);
4130 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4131 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4132 __Pyx_GOTREF(__pyx_t_3);
4133 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4134 __Pyx_GOTREF(__pyx_t_4);
4135 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4136 __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_nnz);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4137 __Pyx_GOTREF(__pyx_t_3);
4138 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4139 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4140 __Pyx_GOTREF(__pyx_t_4);
4141 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4142 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4143 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4144 __pyx_v_nzvals = __pyx_t_4;
4154 __Pyx_XDECREF(__pyx_r);
4155 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
4156 __Pyx_GOTREF(__pyx_t_4);
4157 __Pyx_INCREF(__pyx_v_rowptr);
4158 __Pyx_GIVEREF(__pyx_v_rowptr);
4159 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rowptr);
4160 __Pyx_INCREF(__pyx_v_colind);
4161 __Pyx_GIVEREF(__pyx_v_colind);
4162 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_colind);
4163 __Pyx_INCREF(__pyx_v_nzvals);
4164 __Pyx_GIVEREF(__pyx_v_nzvals);
4165 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nzvals);
4166 __pyx_r = __pyx_t_4;
4180 __Pyx_XDECREF(__pyx_t_1);
4181 __Pyx_XDECREF(__pyx_t_3);
4182 __Pyx_XDECREF(__pyx_t_4);
4183 __Pyx_XDECREF(__pyx_t_5);
4184 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
4187 __Pyx_XDECREF(__pyx_v__rows);
4188 __Pyx_XDECREF(__pyx_v_nnz);
4189 __Pyx_XDECREF(__pyx_v_rowptr);
4190 __Pyx_XDECREF(__pyx_v_colind);
4191 __Pyx_XDECREF(__pyx_v_nzvals);
4192 __Pyx_XGIVEREF(__pyx_r);
4193 __Pyx_RefNannyFinishContext();
4206 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4207 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4211 __Pyx_memviewslice __pyx_v_nzval = { 0, 0, { 0 }, { 0 }, { 0 } };
4212 __Pyx_memviewslice __pyx_v_colind = { 0, 0, { 0 }, { 0 }, { 0 } };
4213 __Pyx_memviewslice __pyx_v_rowptr = { 0, 0, { 0 }, { 0 }, { 0 } };
4215 __Pyx_RefNannyDeclarations
4216 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
4218 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzval,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
4219 PyObject* values[6] = {0,0,0,0,0,0};
4220 if (unlikely(__pyx_kwds)) {
4222 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4224 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4226 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4228 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4230 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4232 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4234 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4237 default:
goto __pyx_L5_argtuple_error;
4239 kw_args = PyDict_Size(__pyx_kwds);
4242 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
4243 else goto __pyx_L5_argtuple_error;
4246 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
4248 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, 1); __PYX_ERR(0, 102, __pyx_L3_error)
4252 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
4254 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, 2); __PYX_ERR(0, 102, __pyx_L3_error)
4258 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzval)) != 0)) kw_args--;
4260 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, 3); __PYX_ERR(0, 102, __pyx_L3_error)
4264 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
4266 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, 4); __PYX_ERR(0, 102, __pyx_L3_error)
4270 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
4272 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, 5); __PYX_ERR(0, 102, __pyx_L3_error)
4275 if (unlikely(kw_args > 0)) {
4276 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
4278 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4279 goto __pyx_L5_argtuple_error;
4281 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4282 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4283 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4284 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4285 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4286 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4288 __pyx_v_nr = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nr == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
4289 __pyx_v_nc = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_nc == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
4290 __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_nnz == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error)
4291 __pyx_v_nzval = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nzval.memview)) __PYX_ERR(0, 106, __pyx_L3_error)
4292 __pyx_v_colind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[4], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_colind.memview)) __PYX_ERR(0, 107, __pyx_L3_error)
4293 __pyx_v_rowptr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_rowptr.memview)) __PYX_ERR(0, 108, __pyx_L3_error)
4295 goto __pyx_L4_argument_unpacking_done;
4296 __pyx_L5_argtuple_error:;
4297 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
4299 __Pyx_AddTraceback(
"superluWrappers.cSparseMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4300 __Pyx_RefNannyFinishContext();
4302 __pyx_L4_argument_unpacking_done:;
4303 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzval, __pyx_v_colind, __pyx_v_rowptr);
4306 __Pyx_RefNannyFinishContext();
4310 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self,
int __pyx_v_nr,
int __pyx_v_nc,
int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr) {
4312 __Pyx_RefNannyDeclarations
4313 Py_ssize_t __pyx_t_1;
4314 Py_ssize_t __pyx_t_2;
4315 Py_ssize_t __pyx_t_3;
4316 __Pyx_RefNannySetupContext(
"__cinit__", 0);
4325 (__pyx_v_self->dim[0]) = __pyx_v_nr;
4326 (__pyx_v_self->dim[1]) = __pyx_v_nc;
4335 __pyx_v_self->A.nnz = __pyx_v_nnz;
4345 __pyx_v_self->A.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( (__pyx_v_nzval.data + __pyx_t_1 * __pyx_v_nzval.strides[0]) ))));
4355 __pyx_v_self->A.colind = (&(*((__pyx_t_5numpy_int32_t *) ( (__pyx_v_colind.data + __pyx_t_2 * __pyx_v_colind.strides[0]) ))));
4365 __pyx_v_self->A.rowptr = (&(*((__pyx_t_5numpy_int32_t *) ( (__pyx_v_rowptr.data + __pyx_t_3 * __pyx_v_rowptr.strides[0]) ))));
4377 __PYX_XDEC_MEMVIEW(&__pyx_v_nzval, 1);
4378 __PYX_XDEC_MEMVIEW(&__pyx_v_colind, 1);
4379 __PYX_XDEC_MEMVIEW(&__pyx_v_rowptr, 1);
4380 __Pyx_RefNannyFinishContext();
4391 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4392 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4393 PyObject *__pyx_r = 0;
4394 __Pyx_RefNannyDeclarations
4395 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
4396 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self));
4399 __Pyx_RefNannyFinishContext();
4403 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self) {
4404 PyObject *__pyx_r = NULL;
4405 __Pyx_RefNannyDeclarations
4406 PyObject *__pyx_t_1 = NULL;
4407 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
4415 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
4416 __Pyx_GOTREF(__pyx_t_1);
4417 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4418 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4419 __PYX_ERR(1, 2, __pyx_L1_error)
4429 __Pyx_XDECREF(__pyx_t_1);
4430 __Pyx_AddTraceback(
"superluWrappers.cSparseMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4432 __Pyx_XGIVEREF(__pyx_r);
4433 __Pyx_RefNannyFinishContext();
4445 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
4446 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4447 PyObject *__pyx_r = 0;
4448 __Pyx_RefNannyDeclarations
4449 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
4450 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4453 __Pyx_RefNannyFinishContext();
4457 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4458 PyObject *__pyx_r = NULL;
4459 __Pyx_RefNannyDeclarations
4460 PyObject *__pyx_t_1 = NULL;
4461 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
4468 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
4469 __Pyx_GOTREF(__pyx_t_1);
4470 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4471 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4472 __PYX_ERR(1, 4, __pyx_L1_error)
4483 __Pyx_XDECREF(__pyx_t_1);
4484 __Pyx_AddTraceback(
"superluWrappers.cSparseMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4486 __Pyx_XGIVEREF(__pyx_r);
4487 __Pyx_RefNannyFinishContext();
4499 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, __Pyx_memviewslice __pyx_v_xp, __Pyx_memviewslice __pyx_v_yp) {
4500 __pyx_t_5numpy_float64_t __pyx_v_tmp;
4503 __Pyx_RefNannyDeclarations
4504 __pyx_t_5numpy_int32_t __pyx_t_1;
4505 __pyx_t_5numpy_int32_t __pyx_t_2;
4507 __pyx_t_5numpy_int32_t __pyx_t_4;
4508 __pyx_t_5numpy_int32_t __pyx_t_5;
4510 Py_ssize_t __pyx_t_7;
4511 Py_ssize_t __pyx_t_8;
4512 __Pyx_RefNannySetupContext(
"SparseMatrix_matvec", 0);
4530 __pyx_t_1 = (__pyx_v_sm->dim[0]);
4531 __pyx_t_2 = __pyx_t_1;
4532 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4533 __pyx_v_i = __pyx_t_3;
4551 __pyx_t_4 = (__pyx_v_sm->A.rowptr[(__pyx_v_i + 1)]);
4552 __pyx_t_5 = __pyx_t_4;
4553 for (__pyx_t_6 = (__pyx_v_sm->A.rowptr[__pyx_v_i]); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4554 __pyx_v_k = __pyx_t_6;
4563 __pyx_t_7 = (__pyx_v_sm->A.colind[__pyx_v_k]);
4564 __pyx_v_tmp = (__pyx_v_tmp + ((__pyx_v_sm->A.nzval[__pyx_v_k]) * (*((__pyx_t_5numpy_float64_t *) ( (__pyx_v_xp.data + __pyx_t_7 * __pyx_v_xp.strides[0]) )))));
4574 __pyx_t_8 = __pyx_v_i;
4575 *((__pyx_t_5numpy_float64_t *) ( (__pyx_v_yp.data + __pyx_t_8 * __pyx_v_yp.strides[0]) )) = __pyx_v_tmp;
4587 __Pyx_RefNannyFinishContext();
4599 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4600 static char __pyx_doc_15superluWrappers_12SparseFactor___init__[] =
"\n Arguments\n ---------\n dim : int\n Dimension of the sparse factor.\n ";
4601 #if CYTHON_COMPILING_IN_CPYTHON
4602 struct wrapperbase __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
4604 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4605 PyObject *__pyx_v_dim = 0;
4607 __Pyx_RefNannyDeclarations
4608 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
4610 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0};
4611 PyObject* values[1] = {0};
4612 if (unlikely(__pyx_kwds)) {
4614 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4616 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4619 default:
goto __pyx_L5_argtuple_error;
4621 kw_args = PyDict_Size(__pyx_kwds);
4624 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
4625 else goto __pyx_L5_argtuple_error;
4627 if (unlikely(kw_args > 0)) {
4628 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 170, __pyx_L3_error)
4630 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
4631 goto __pyx_L5_argtuple_error;
4633 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4635 __pyx_v_dim = values[0];
4637 goto __pyx_L4_argument_unpacking_done;
4638 __pyx_L5_argtuple_error:;
4639 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 170, __pyx_L3_error)
4641 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4642 __Pyx_RefNannyFinishContext();
4644 __pyx_L4_argument_unpacking_done:;
4645 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor___init__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), __pyx_v_dim);
4648 __Pyx_RefNannyFinishContext();
4652 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim) {
4654 __Pyx_RefNannyDeclarations
4655 PyObject *__pyx_t_1 = NULL;
4657 __pyx_t_5numpy_int32_t __pyx_t_3;
4658 PyObject *__pyx_t_4 = NULL;
4660 __Pyx_RefNannySetupContext(
"__init__", 0);
4669 StatInit((&__pyx_v_self->stat));
4678 set_default_options((&__pyx_v_self->options));
4687 __pyx_t_1 = ((
struct __pyx_vtabstruct_15superluWrappers_SparseFactor *)__pyx_v_self->__pyx_vtab)->_set_mat_types(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
4688 __Pyx_GOTREF(__pyx_t_1);
4689 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4698 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
4699 __pyx_v_self->dim = __pyx_t_2;
4708 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4709 __pyx_v_self->A.nrow = __pyx_t_2;
4710 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4711 __pyx_v_self->A.ncol = __pyx_t_2;
4720 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4721 __pyx_v_self->AC.nrow = __pyx_t_2;
4722 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4723 __pyx_v_self->AC.ncol = __pyx_t_2;
4732 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4733 __pyx_v_self->L.nrow = __pyx_t_2;
4734 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4735 __pyx_v_self->L.ncol = __pyx_t_2;
4744 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4745 __pyx_v_self->U.nrow = __pyx_t_2;
4746 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4747 __pyx_v_self->U.ncol = __pyx_t_2;
4756 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4757 __pyx_v_self->X.nrow = __pyx_t_2;
4758 __pyx_v_self->X.ncol = 1;
4767 __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_v_dim);
if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4768 __pyx_v_self->storeX.lda = __pyx_t_3;
4777 __pyx_v_self->use_same_perm_c = 0;
4786 __pyx_v_self->use_same_sparsity = 0;
4795 __pyx_t_1 = __Pyx_PyInt_FromSize_t((
sizeof(__pyx_t_5numpy_int32_t)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
4796 __Pyx_GOTREF(__pyx_t_1);
4797 __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
4798 __Pyx_GOTREF(__pyx_t_4);
4799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4800 __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
4801 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4802 __pyx_v_self->perm_c = ((
int *)malloc(__pyx_t_5));
4811 __pyx_t_4 = __Pyx_PyInt_FromSize_t((
sizeof(__pyx_t_5numpy_int32_t)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
4812 __Pyx_GOTREF(__pyx_t_4);
4813 __pyx_t_1 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
4814 __Pyx_GOTREF(__pyx_t_1);
4815 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4816 __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_1);
if (unlikely((__pyx_t_5 == (
size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L1_error)
4817 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4818 __pyx_v_self->perm_r = ((
int *)malloc(__pyx_t_5));
4827 __pyx_t_1 = __Pyx_PyInt_FromSize_t((
sizeof(__pyx_t_5numpy_int32_t)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
4828 __Pyx_GOTREF(__pyx_t_1);
4829 __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
4830 __Pyx_GOTREF(__pyx_t_4);
4831 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4832 __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L1_error)
4833 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4834 __pyx_v_self->etree = ((
int *)malloc(__pyx_t_5));
4848 __Pyx_XDECREF(__pyx_t_1);
4849 __Pyx_XDECREF(__pyx_t_4);
4850 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4853 __Pyx_RefNannyFinishContext();
4865 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
4866 PyObject *__pyx_r = NULL;
4867 __Pyx_RefNannyDeclarations
4868 __Pyx_RefNannySetupContext(
"_set_mat_types", 0);
4877 __pyx_v_self->A.Stype = SLU_NC;
4886 __pyx_v_self->A.Dtype = SLU_D;
4895 __pyx_v_self->A.Mtype = SLU_GE;
4904 __pyx_v_self->A.Store = (&__pyx_v_self->storeA);
4913 __pyx_v_self->AC.Stype = SLU_NCP;
4922 __pyx_v_self->AC.Dtype = SLU_D;
4931 __pyx_v_self->AC.Mtype = SLU_GE;
4940 __pyx_v_self->AC.Store = NULL;
4949 __pyx_v_self->L.Stype = SLU_NC;
4958 __pyx_v_self->L.Dtype = SLU_D;
4967 __pyx_v_self->L.Mtype = SLU_TRLU;
4976 __pyx_v_self->L.Store = NULL;
4985 __pyx_v_self->U.Stype = SLU_NC;
4994 __pyx_v_self->U.Dtype = SLU_D;
5003 __pyx_v_self->U.Mtype = SLU_TRU;
5012 __pyx_v_self->U.Store = NULL;
5021 __pyx_v_self->X.Stype = SLU_DN;
5030 __pyx_v_self->X.Dtype = SLU_D;
5039 __pyx_v_self->X.Mtype = SLU_GE;
5048 __pyx_v_self->X.Store = (&__pyx_v_self->storeX);
5059 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5060 __Pyx_XGIVEREF(__pyx_r);
5061 __Pyx_RefNannyFinishContext();
5074 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self);
5075 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self) {
5076 PyObject *__pyx_r = 0;
5077 __Pyx_RefNannyDeclarations
5078 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
5079 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5082 __Pyx_RefNannyFinishContext();
5086 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5087 PyObject *__pyx_r = NULL;
5088 __Pyx_RefNannyDeclarations
5089 PyObject *__pyx_t_1 = NULL;
5090 __Pyx_RefNannySetupContext(
"__get__", 0);
5091 __Pyx_XDECREF(__pyx_r);
5092 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->dim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
5093 __Pyx_GOTREF(__pyx_t_1);
5094 __pyx_r = __pyx_t_1;
5100 __Pyx_XDECREF(__pyx_t_1);
5101 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5104 __Pyx_XGIVEREF(__pyx_r);
5105 __Pyx_RefNannyFinishContext();
5110 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
5111 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5113 __Pyx_RefNannyDeclarations
5114 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
5115 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5118 __Pyx_RefNannyFinishContext();
5122 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value) {
5124 __Pyx_RefNannyDeclarations
5126 __Pyx_RefNannySetupContext(
"__set__", 0);
5127 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
5128 __pyx_v_self->dim = __pyx_t_1;
5134 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.dim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5137 __Pyx_RefNannyFinishContext();
5148 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5149 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5150 PyObject *__pyx_r = 0;
5151 __Pyx_RefNannyDeclarations
5152 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5153 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5156 __Pyx_RefNannyFinishContext();
5160 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5161 PyObject *__pyx_r = NULL;
5162 __Pyx_RefNannyDeclarations
5163 PyObject *__pyx_t_1 = NULL;
5164 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5172 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5173 __Pyx_GOTREF(__pyx_t_1);
5174 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5175 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5176 __PYX_ERR(1, 2, __pyx_L1_error)
5186 __Pyx_XDECREF(__pyx_t_1);
5187 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5189 __Pyx_XGIVEREF(__pyx_r);
5190 __Pyx_RefNannyFinishContext();
5202 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5203 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5204 PyObject *__pyx_r = 0;
5205 __Pyx_RefNannyDeclarations
5206 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5207 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5210 __Pyx_RefNannyFinishContext();
5214 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5215 PyObject *__pyx_r = NULL;
5216 __Pyx_RefNannyDeclarations
5217 PyObject *__pyx_t_1 = NULL;
5218 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5225 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5226 __Pyx_GOTREF(__pyx_t_1);
5227 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5228 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5229 __PYX_ERR(1, 4, __pyx_L1_error)
5240 __Pyx_XDECREF(__pyx_t_1);
5241 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5243 __Pyx_XGIVEREF(__pyx_r);
5244 __Pyx_RefNannyFinishContext();
5257 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5258 static char __pyx_doc_15superluWrappers_sparseFactorPrepare[] =
" Python wrapper for superlu Sparse Factor Prepare function.\n\n Arguments\n ---------\n sparse_matrix : superluWrappers.SparseMatrix\n sparseFactor: superluWrappers.SparseFactor\n\n ";
5259 static PyMethodDef __pyx_mdef_15superluWrappers_1sparseFactorPrepare = {
"sparseFactorPrepare", (PyCFunction)__pyx_pw_15superluWrappers_1sparseFactorPrepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_sparseFactorPrepare};
5260 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5261 PyObject *__pyx_v_sparse_matrix = 0;
5262 PyObject *__pyx_v_sparseFactor = 0;
5263 PyObject *__pyx_r = 0;
5264 __Pyx_RefNannyDeclarations
5265 __Pyx_RefNannySetupContext(
"sparseFactorPrepare (wrapper)", 0);
5267 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparse_matrix,&__pyx_n_s_sparseFactor,0};
5268 PyObject* values[2] = {0,0};
5269 if (unlikely(__pyx_kwds)) {
5271 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5273 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5275 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5278 default:
goto __pyx_L5_argtuple_error;
5280 kw_args = PyDict_Size(__pyx_kwds);
5283 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparse_matrix)) != 0)) kw_args--;
5284 else goto __pyx_L5_argtuple_error;
5287 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5289 __Pyx_RaiseArgtupleInvalid(
"sparseFactorPrepare", 1, 2, 2, 1); __PYX_ERR(0, 219, __pyx_L3_error)
5292 if (unlikely(kw_args > 0)) {
5293 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sparseFactorPrepare") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
5295 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5296 goto __pyx_L5_argtuple_error;
5298 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5299 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5301 __pyx_v_sparse_matrix = values[0];
5302 __pyx_v_sparseFactor = values[1];
5304 goto __pyx_L4_argument_unpacking_done;
5305 __pyx_L5_argtuple_error:;
5306 __Pyx_RaiseArgtupleInvalid(
"sparseFactorPrepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
5308 __Pyx_AddTraceback(
"superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5309 __Pyx_RefNannyFinishContext();
5311 __pyx_L4_argument_unpacking_done:;
5312 __pyx_r = __pyx_pf_15superluWrappers_sparseFactorPrepare(__pyx_self, __pyx_v_sparse_matrix, __pyx_v_sparseFactor);
5315 __Pyx_RefNannyFinishContext();
5319 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor) {
5320 PyObject *__pyx_r = NULL;
5321 __Pyx_RefNannyDeclarations
5322 PyObject *__pyx_t_1 = NULL;
5323 __Pyx_RefNannySetupContext(
"sparseFactorPrepare", 0);
5332 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sparse_matrix, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5333 __Pyx_GOTREF(__pyx_t_1);
5334 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5343 if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 230, __pyx_L1_error)
5352 __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor));
5353 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5364 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5367 __Pyx_XDECREF(__pyx_t_1);
5368 __Pyx_AddTraceback(
"superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5371 __Pyx_XGIVEREF(__pyx_r);
5372 __Pyx_RefNannyFinishContext();
5384 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor) {
5385 int __pyx_v_permc_spec;
5388 int __pyx_v_panel_size;
5392 PyObject *__pyx_v_i = NULL;
5393 __Pyx_RefNannyDeclarations
5394 __pyx_t_5numpy_int32_t __pyx_t_1;
5397 PyObject *__pyx_t_4 = NULL;
5398 PyObject *__pyx_t_5 = NULL;
5399 Py_ssize_t __pyx_t_6;
5400 PyObject *(*__pyx_t_7)(PyObject *);
5401 Py_ssize_t __pyx_t_8;
5402 Py_ssize_t __pyx_t_9;
5403 __Pyx_RefNannySetupContext(
"superluWrappersSparseFactorPrepare", 0);
5412 __pyx_v_permc_spec = 3;
5430 __pyx_v_panel_size = 10;
5457 __pyx_v_work = NULL;
5466 __pyx_t_1 = __pyx_v_sm->A.nnz;
5467 __pyx_v_sparseFactor->storeA.nnz = __pyx_t_1;
5476 __pyx_v_sparseFactor->storeA.nzval = (&(__pyx_v_sm->A.nzval[0]));
5485 __pyx_v_sparseFactor->storeA.colptr = (&(__pyx_v_sm->A.rowptr[0]));
5494 __pyx_v_sparseFactor->storeA.rowind = (&(__pyx_v_sm->A.colind[0]));
5503 __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_perm_c == 0) != 0);
5513 get_perm_c(__pyx_v_permc_spec, (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c);
5522 __pyx_v_sparseFactor->use_same_perm_c = 1;
5540 __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_sparsity == 0) != 0);
5550 __pyx_t_2 = ((__pyx_v_sparseFactor->AC.Store != NULL) != 0);
5560 Destroy_CompCol_Permuted((&__pyx_v_sparseFactor->AC));
5569 Destroy_SuperNode_Matrix((&__pyx_v_sparseFactor->L));
5578 Destroy_CompCol_Matrix((&__pyx_v_sparseFactor->U));
5596 sp_preorder((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->etree, (&__pyx_v_sparseFactor->AC));
5605 __pyx_v_sparseFactor->use_same_sparsity = 1;
5625 __pyx_v_sparseFactor->options.Fact = SamePattern_SameRowPerm;
5634 __pyx_t_3 = __pyx_v_sparseFactor->A.ncol;
5635 __pyx_v_n = __pyx_t_3;
5644 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5645 __Pyx_GOTREF(__pyx_t_4);
5646 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5647 __Pyx_GOTREF(__pyx_t_5);
5648 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5649 if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
5650 __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
5653 __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5654 __Pyx_GOTREF(__pyx_t_4);
5655 __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
5657 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5659 if (likely(!__pyx_t_7)) {
5660 if (likely(PyList_CheckExact(__pyx_t_4))) {
5661 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4))
break;
5662 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5663 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5665 __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5666 __Pyx_GOTREF(__pyx_t_5);
5669 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
5670 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5671 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5673 __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5674 __Pyx_GOTREF(__pyx_t_5);
5678 __pyx_t_5 = __pyx_t_7(__pyx_t_4);
5679 if (unlikely(!__pyx_t_5)) {
5680 PyObject* exc_type = PyErr_Occurred();
5682 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5683 else __PYX_ERR(0, 268, __pyx_L1_error)
5687 __Pyx_GOTREF(__pyx_t_5);
5689 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
5699 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i);
if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5700 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5701 (((
struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colbeg[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((
struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5710 __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error)
5711 __Pyx_GOTREF(__pyx_t_5);
5712 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5713 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5714 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5715 (((
struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colend[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((
struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5725 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5736 dgstrf((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->AC), __pyx_v_relax, __pyx_v_panel_size, __pyx_v_sparseFactor->etree, __pyx_v_work, __pyx_v_lwork, __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), (&__pyx_v_sparseFactor->Glu), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
5749 __Pyx_XDECREF(__pyx_t_4);
5750 __Pyx_XDECREF(__pyx_t_5);
5751 __Pyx_WriteUnraisable(
"superluWrappers.superluWrappersSparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5753 __Pyx_XDECREF(__pyx_v_i);
5754 __Pyx_RefNannyFinishContext();
5766 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5767 static char __pyx_doc_15superluWrappers_2sparseFactorSolve[] =
" Sparse factor solve wrappers\n\n Arguments\n ---------\n sparseFactor : superluWrappers.SparseFactor\n x (input / output) : np.array\n x serves as the right hand side and then becomes the solution\n ";
5768 static PyMethodDef __pyx_mdef_15superluWrappers_3sparseFactorSolve = {
"sparseFactorSolve", (PyCFunction)__pyx_pw_15superluWrappers_3sparseFactorSolve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_2sparseFactorSolve};
5769 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5770 PyObject *__pyx_v_sparseFactor = 0;
5771 PyObject *__pyx_v_x = 0;
5772 PyObject *__pyx_r = 0;
5773 __Pyx_RefNannyDeclarations
5774 __Pyx_RefNannySetupContext(
"sparseFactorSolve (wrapper)", 0);
5776 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparseFactor,&__pyx_n_s_x,0};
5777 PyObject* values[2] = {0,0};
5778 if (unlikely(__pyx_kwds)) {
5780 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5782 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5784 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5787 default:
goto __pyx_L5_argtuple_error;
5789 kw_args = PyDict_Size(__pyx_kwds);
5792 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5793 else goto __pyx_L5_argtuple_error;
5796 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5798 __Pyx_RaiseArgtupleInvalid(
"sparseFactorSolve", 1, 2, 2, 1); __PYX_ERR(0, 286, __pyx_L3_error)
5801 if (unlikely(kw_args > 0)) {
5802 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"sparseFactorSolve") < 0)) __PYX_ERR(0, 286, __pyx_L3_error)
5804 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5805 goto __pyx_L5_argtuple_error;
5807 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5808 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5810 __pyx_v_sparseFactor = values[0];
5811 __pyx_v_x = values[1];
5813 goto __pyx_L4_argument_unpacking_done;
5814 __pyx_L5_argtuple_error:;
5815 __Pyx_RaiseArgtupleInvalid(
"sparseFactorSolve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 286, __pyx_L3_error)
5817 __Pyx_AddTraceback(
"superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5818 __Pyx_RefNannyFinishContext();
5820 __pyx_L4_argument_unpacking_done:;
5821 __pyx_r = __pyx_pf_15superluWrappers_2sparseFactorSolve(__pyx_self, __pyx_v_sparseFactor, __pyx_v_x);
5824 __Pyx_RefNannyFinishContext();
5828 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x) {
5829 PyObject *__pyx_r = NULL;
5830 __Pyx_RefNannyDeclarations
5831 __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
5832 __Pyx_RefNannySetupContext(
"sparseFactorSolve", 0);
5841 if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 296, __pyx_L1_error)
5850 __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
5859 __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor), __pyx_t_1);
5860 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5861 __pyx_t_1.memview = NULL;
5862 __pyx_t_1.data = NULL;
5873 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5876 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5877 __Pyx_AddTraceback(
"superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5880 __Pyx_XGIVEREF(__pyx_r);
5881 __Pyx_RefNannyFinishContext();
5893 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor, __Pyx_memviewslice __pyx_v_x) {
5894 trans_t __pyx_v_trans;
5896 __Pyx_RefNannyDeclarations
5897 Py_ssize_t __pyx_t_1;
5898 __Pyx_RefNannySetupContext(
"superluWrappersSparseFactorSolve", 0);
5907 __pyx_v_trans = TRANS;
5926 __pyx_v_sparseFactor->storeX.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( (__pyx_v_x.data + __pyx_t_1 * __pyx_v_x.strides[0]) ))));
5935 dgstrs(__pyx_v_trans, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->X), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
5946 __Pyx_RefNannyFinishContext();
5958 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
5959 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5961 __Pyx_RefNannyDeclarations
5962 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
5963 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
5966 __Pyx_RefNannyFinishContext();
5970 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5973 int __pyx_v_endian_detector;
5974 int __pyx_v_little_endian;
5977 PyArray_Descr *__pyx_v_descr = 0;
5980 __Pyx_RefNannyDeclarations
5983 PyObject *__pyx_t_3 = NULL;
5987 PyObject *__pyx_t_7 = NULL;
5989 if (__pyx_v_info == NULL) {
5990 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
5993 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
5994 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5995 __Pyx_GIVEREF(__pyx_v_info->obj);
6004 __pyx_v_endian_detector = 1;
6013 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
6022 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
6031 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
6034 __pyx_t_1 = __pyx_t_2;
6035 goto __pyx_L4_bool_binop_done;
6045 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
6046 __pyx_t_1 = __pyx_t_2;
6047 __pyx_L4_bool_binop_done:;
6056 if (unlikely(__pyx_t_1)) {
6065 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error)
6066 __Pyx_GOTREF(__pyx_t_3);
6067 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6068 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6069 __PYX_ERR(2, 229, __pyx_L1_error)
6087 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
6090 __pyx_t_1 = __pyx_t_2;
6091 goto __pyx_L7_bool_binop_done;
6101 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
6102 __pyx_t_1 = __pyx_t_2;
6103 __pyx_L7_bool_binop_done:;
6112 if (unlikely(__pyx_t_1)) {
6121 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 233, __pyx_L1_error)
6122 __Pyx_GOTREF(__pyx_t_3);
6123 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6124 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6125 __PYX_ERR(2, 233, __pyx_L1_error)
6143 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
6152 __pyx_v_info->ndim = __pyx_v_ndim;
6161 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
6171 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
6180 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
6189 __pyx_t_4 = __pyx_v_ndim;
6190 __pyx_t_5 = __pyx_t_4;
6191 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6192 __pyx_v_i = __pyx_t_6;
6201 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
6210 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
6231 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
6240 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
6251 __pyx_v_info->suboffsets = NULL;
6260 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
6269 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
6287 __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
6288 __Pyx_INCREF(__pyx_t_3);
6289 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
6299 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6300 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6301 __Pyx_GOTREF(__pyx_v_info->obj);
6302 __Pyx_DECREF(__pyx_v_info->obj);
6303 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6312 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
6322 __pyx_t_4 = __pyx_v_descr->type_num;
6323 __pyx_v_t = __pyx_t_4;
6332 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
6334 goto __pyx_L15_next_or;
6337 __pyx_t_2 = (__pyx_v_little_endian != 0);
6340 __pyx_t_1 = __pyx_t_2;
6341 goto __pyx_L14_bool_binop_done;
6352 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
6355 __pyx_t_1 = __pyx_t_2;
6356 goto __pyx_L14_bool_binop_done;
6358 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
6359 __pyx_t_1 = __pyx_t_2;
6360 __pyx_L14_bool_binop_done:;
6369 if (unlikely(__pyx_t_1)) {
6378 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 263, __pyx_L1_error)
6379 __Pyx_GOTREF(__pyx_t_3);
6380 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6381 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6382 __PYX_ERR(2, 263, __pyx_L1_error)
6400 switch (__pyx_v_t) {
6402 __pyx_v_f = ((
char *)
"b");
6413 __pyx_v_f = ((
char *)
"B");
6424 __pyx_v_f = ((
char *)
"h");
6435 __pyx_v_f = ((
char *)
"H");
6446 __pyx_v_f = ((
char *)
"i");
6457 __pyx_v_f = ((
char *)
"I");
6468 __pyx_v_f = ((
char *)
"l");
6479 __pyx_v_f = ((
char *)
"L");
6490 __pyx_v_f = ((
char *)
"q");
6501 __pyx_v_f = ((
char *)
"Q");
6512 __pyx_v_f = ((
char *)
"f");
6523 __pyx_v_f = ((
char *)
"d");
6533 case NPY_LONGDOUBLE:
6534 __pyx_v_f = ((
char *)
"g");
6545 __pyx_v_f = ((
char *)
"Zf");
6556 __pyx_v_f = ((
char *)
"Zd");
6566 case NPY_CLONGDOUBLE:
6567 __pyx_v_f = ((
char *)
"Zg");
6578 __pyx_v_f = ((
char *)
"O");
6589 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error)
6590 __Pyx_GOTREF(__pyx_t_3);
6591 __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3);
if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 282, __pyx_L1_error)
6592 __Pyx_GOTREF(__pyx_t_7);
6593 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6594 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error)
6595 __Pyx_GOTREF(__pyx_t_3);
6596 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6597 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6598 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6599 __PYX_ERR(2, 282, __pyx_L1_error)
6610 __pyx_v_info->format = __pyx_v_f;
6639 __pyx_v_info->format = ((
char *)PyObject_Malloc(0xFF));
6648 (__pyx_v_info->format[0]) =
'^';
6666 __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_8 == ((
char *)NULL))) __PYX_ERR(2, 289, __pyx_L1_error)
6667 __pyx_v_f = __pyx_t_8;
6676 (__pyx_v_f[0]) =
'\x00';
6691 __Pyx_XDECREF(__pyx_t_3);
6692 __Pyx_XDECREF(__pyx_t_7);
6693 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6695 if (__pyx_v_info->obj != NULL) {
6696 __Pyx_GOTREF(__pyx_v_info->obj);
6697 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6701 if (__pyx_v_info->obj == Py_None) {
6702 __Pyx_GOTREF(__pyx_v_info->obj);
6703 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6706 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
6707 __Pyx_RefNannyFinishContext();
6720 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
6721 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6722 __Pyx_RefNannyDeclarations
6723 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
6724 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
6727 __Pyx_RefNannyFinishContext();
6730 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6731 __Pyx_RefNannyDeclarations
6733 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
6742 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
6752 PyObject_Free(__pyx_v_info->format);
6770 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
6780 PyObject_Free(__pyx_v_info->strides);
6800 __Pyx_RefNannyFinishContext();
6811 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6812 PyObject *__pyx_r = NULL;
6813 __Pyx_RefNannyDeclarations
6814 PyObject *__pyx_t_1 = NULL;
6815 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
6824 __Pyx_XDECREF(__pyx_r);
6825 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 776, __pyx_L1_error)
6826 __Pyx_GOTREF(__pyx_t_1);
6827 __pyx_r = __pyx_t_1;
6841 __Pyx_XDECREF(__pyx_t_1);
6842 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6845 __Pyx_XGIVEREF(__pyx_r);
6846 __Pyx_RefNannyFinishContext();
6858 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6859 PyObject *__pyx_r = NULL;
6860 __Pyx_RefNannyDeclarations
6861 PyObject *__pyx_t_1 = NULL;
6862 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
6871 __Pyx_XDECREF(__pyx_r);
6872 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 779, __pyx_L1_error)
6873 __Pyx_GOTREF(__pyx_t_1);
6874 __pyx_r = __pyx_t_1;
6888 __Pyx_XDECREF(__pyx_t_1);
6889 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6892 __Pyx_XGIVEREF(__pyx_r);
6893 __Pyx_RefNannyFinishContext();
6905 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6906 PyObject *__pyx_r = NULL;
6907 __Pyx_RefNannyDeclarations
6908 PyObject *__pyx_t_1 = NULL;
6909 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
6918 __Pyx_XDECREF(__pyx_r);
6919 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 782, __pyx_L1_error)
6920 __Pyx_GOTREF(__pyx_t_1);
6921 __pyx_r = __pyx_t_1;
6935 __Pyx_XDECREF(__pyx_t_1);
6936 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6939 __Pyx_XGIVEREF(__pyx_r);
6940 __Pyx_RefNannyFinishContext();
6952 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6953 PyObject *__pyx_r = NULL;
6954 __Pyx_RefNannyDeclarations
6955 PyObject *__pyx_t_1 = NULL;
6956 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
6965 __Pyx_XDECREF(__pyx_r);
6966 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 785, __pyx_L1_error)
6967 __Pyx_GOTREF(__pyx_t_1);
6968 __pyx_r = __pyx_t_1;
6982 __Pyx_XDECREF(__pyx_t_1);
6983 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6986 __Pyx_XGIVEREF(__pyx_r);
6987 __Pyx_RefNannyFinishContext();
6999 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7000 PyObject *__pyx_r = NULL;
7001 __Pyx_RefNannyDeclarations
7002 PyObject *__pyx_t_1 = NULL;
7003 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
7012 __Pyx_XDECREF(__pyx_r);
7013 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 788, __pyx_L1_error)
7014 __Pyx_GOTREF(__pyx_t_1);
7015 __pyx_r = __pyx_t_1;
7029 __Pyx_XDECREF(__pyx_t_1);
7030 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7033 __Pyx_XGIVEREF(__pyx_r);
7034 __Pyx_RefNannyFinishContext();
7046 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7047 PyObject *__pyx_r = NULL;
7048 __Pyx_RefNannyDeclarations
7050 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
7059 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7069 __Pyx_XDECREF(__pyx_r);
7070 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7071 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7091 __Pyx_XDECREF(__pyx_r);
7092 __Pyx_INCREF(__pyx_empty_tuple);
7093 __pyx_r = __pyx_empty_tuple;
7107 __Pyx_XGIVEREF(__pyx_r);
7108 __Pyx_RefNannyFinishContext();
7120 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
7121 PyArray_Descr *__pyx_v_child = 0;
7122 int __pyx_v_endian_detector;
7123 int __pyx_v_little_endian;
7124 PyObject *__pyx_v_fields = 0;
7125 PyObject *__pyx_v_childname = NULL;
7126 PyObject *__pyx_v_new_offset = NULL;
7127 PyObject *__pyx_v_t = NULL;
7129 __Pyx_RefNannyDeclarations
7130 PyObject *__pyx_t_1 = NULL;
7131 Py_ssize_t __pyx_t_2;
7132 PyObject *__pyx_t_3 = NULL;
7133 PyObject *__pyx_t_4 = NULL;
7139 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
7148 __pyx_v_endian_detector = 1;
7157 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
7166 if (unlikely(__pyx_v_descr->names == Py_None)) {
7167 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
7168 __PYX_ERR(2, 805, __pyx_L1_error)
7170 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7172 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
7173 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7174 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(2, 805, __pyx_L1_error)
7176 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 805, __pyx_L1_error)
7177 __Pyx_GOTREF(__pyx_t_3);
7179 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
7189 if (unlikely(__pyx_v_descr->fields == Py_None)) {
7190 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7191 __PYX_ERR(2, 806, __pyx_L1_error)
7193 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 806, __pyx_L1_error)
7194 __Pyx_GOTREF(__pyx_t_3);
7195 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 806, __pyx_L1_error)
7196 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
7206 if (likely(__pyx_v_fields != Py_None)) {
7207 PyObject* sequence = __pyx_v_fields;
7208 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7209 if (unlikely(size != 2)) {
7210 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7211 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7212 __PYX_ERR(2, 807, __pyx_L1_error)
7214 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7215 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7216 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7217 __Pyx_INCREF(__pyx_t_3);
7218 __Pyx_INCREF(__pyx_t_4);
7220 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 807, __pyx_L1_error)
7221 __Pyx_GOTREF(__pyx_t_3);
7222 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 807, __pyx_L1_error)
7223 __Pyx_GOTREF(__pyx_t_4);
7226 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 807, __pyx_L1_error)
7228 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 807, __pyx_L1_error)
7229 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7231 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7241 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 809, __pyx_L1_error)
7242 __Pyx_GOTREF(__pyx_t_4);
7243 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 809, __pyx_L1_error)
7244 __Pyx_GOTREF(__pyx_t_3);
7245 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7246 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 809, __pyx_L1_error)
7247 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7248 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
7249 if (unlikely(__pyx_t_6)) {
7258 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 810, __pyx_L1_error)
7259 __Pyx_GOTREF(__pyx_t_3);
7260 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7261 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7262 __PYX_ERR(2, 810, __pyx_L1_error)
7280 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
7282 goto __pyx_L8_next_or;
7285 __pyx_t_7 = (__pyx_v_little_endian != 0);
7288 __pyx_t_6 = __pyx_t_7;
7289 goto __pyx_L7_bool_binop_done;
7300 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
7303 __pyx_t_6 = __pyx_t_7;
7304 goto __pyx_L7_bool_binop_done;
7306 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7307 __pyx_t_6 = __pyx_t_7;
7308 __pyx_L7_bool_binop_done:;
7317 if (unlikely(__pyx_t_6)) {
7326 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 814, __pyx_L1_error)
7327 __Pyx_GOTREF(__pyx_t_3);
7328 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7329 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7330 __PYX_ERR(2, 814, __pyx_L1_error)
7349 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 824, __pyx_L1_error)
7350 __Pyx_GOTREF(__pyx_t_3);
7351 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 824, __pyx_L1_error)
7352 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7353 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 824, __pyx_L1_error)
7354 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7355 if (!__pyx_t_6)
break;
7364 (__pyx_v_f[0]) = 0x78;
7373 __pyx_v_f = (__pyx_v_f + 1);
7383 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7394 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7403 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7413 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error)
7414 __Pyx_GOTREF(__pyx_t_4);
7415 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7425 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7426 if (unlikely(__pyx_t_6)) {
7435 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error)
7436 __Pyx_GOTREF(__pyx_t_4);
7437 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7438 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7439 __PYX_ERR(2, 834, __pyx_L1_error)
7457 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error)
7458 __Pyx_GOTREF(__pyx_t_4);
7459 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error)
7460 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7461 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error)
7462 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7464 (__pyx_v_f[0]) = 98;
7475 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error)
7476 __Pyx_GOTREF(__pyx_t_3);
7477 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error)
7478 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7479 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error)
7480 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7482 (__pyx_v_f[0]) = 66;
7493 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error)
7494 __Pyx_GOTREF(__pyx_t_4);
7495 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error)
7496 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7497 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error)
7498 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7500 (__pyx_v_f[0]) = 0x68;
7511 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error)
7512 __Pyx_GOTREF(__pyx_t_3);
7513 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error)
7514 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7515 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error)
7516 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7518 (__pyx_v_f[0]) = 72;
7529 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error)
7530 __Pyx_GOTREF(__pyx_t_4);
7531 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error)
7532 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7533 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error)
7534 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7536 (__pyx_v_f[0]) = 0x69;
7547 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error)
7548 __Pyx_GOTREF(__pyx_t_3);
7549 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error)
7550 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7551 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error)
7552 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7554 (__pyx_v_f[0]) = 73;
7565 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 843, __pyx_L1_error)
7566 __Pyx_GOTREF(__pyx_t_4);
7567 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 843, __pyx_L1_error)
7568 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7569 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 843, __pyx_L1_error)
7570 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7572 (__pyx_v_f[0]) = 0x6C;
7583 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error)
7584 __Pyx_GOTREF(__pyx_t_3);
7585 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __pyx_L1_error)
7586 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7587 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 844, __pyx_L1_error)
7588 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7590 (__pyx_v_f[0]) = 76;
7601 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 845, __pyx_L1_error)
7602 __Pyx_GOTREF(__pyx_t_4);
7603 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 845, __pyx_L1_error)
7604 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7605 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 845, __pyx_L1_error)
7606 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7608 (__pyx_v_f[0]) = 0x71;
7619 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 846, __pyx_L1_error)
7620 __Pyx_GOTREF(__pyx_t_3);
7621 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 846, __pyx_L1_error)
7622 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7623 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 846, __pyx_L1_error)
7624 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7626 (__pyx_v_f[0]) = 81;
7637 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 847, __pyx_L1_error)
7638 __Pyx_GOTREF(__pyx_t_4);
7639 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 847, __pyx_L1_error)
7640 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7641 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 847, __pyx_L1_error)
7642 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7644 (__pyx_v_f[0]) = 0x66;
7655 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 848, __pyx_L1_error)
7656 __Pyx_GOTREF(__pyx_t_3);
7657 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 848, __pyx_L1_error)
7658 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7659 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 848, __pyx_L1_error)
7660 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7662 (__pyx_v_f[0]) = 0x64;
7673 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 849, __pyx_L1_error)
7674 __Pyx_GOTREF(__pyx_t_4);
7675 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 849, __pyx_L1_error)
7676 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7677 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 849, __pyx_L1_error)
7678 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7680 (__pyx_v_f[0]) = 0x67;
7691 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 850, __pyx_L1_error)
7692 __Pyx_GOTREF(__pyx_t_3);
7693 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 850, __pyx_L1_error)
7694 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7695 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 850, __pyx_L1_error)
7696 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7698 (__pyx_v_f[0]) = 90;
7699 (__pyx_v_f[1]) = 0x66;
7700 __pyx_v_f = (__pyx_v_f + 1);
7711 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 851, __pyx_L1_error)
7712 __Pyx_GOTREF(__pyx_t_4);
7713 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
7714 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7715 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 851, __pyx_L1_error)
7716 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7718 (__pyx_v_f[0]) = 90;
7719 (__pyx_v_f[1]) = 0x64;
7720 __pyx_v_f = (__pyx_v_f + 1);
7731 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
7732 __Pyx_GOTREF(__pyx_t_3);
7733 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 852, __pyx_L1_error)
7734 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7735 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 852, __pyx_L1_error)
7736 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7738 (__pyx_v_f[0]) = 90;
7739 (__pyx_v_f[1]) = 0x67;
7740 __pyx_v_f = (__pyx_v_f + 1);
7751 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
7752 __Pyx_GOTREF(__pyx_t_4);
7753 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
7754 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7755 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 853, __pyx_L1_error)
7756 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7757 if (likely(__pyx_t_6)) {
7758 (__pyx_v_f[0]) = 79;
7770 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
7771 __Pyx_GOTREF(__pyx_t_3);
7772 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
7773 __Pyx_GOTREF(__pyx_t_4);
7774 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7775 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7776 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7777 __PYX_ERR(2, 855, __pyx_L1_error)
7788 __pyx_v_f = (__pyx_v_f + 1);
7808 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(2, 860, __pyx_L1_error)
7809 __pyx_v_f = __pyx_t_9;
7821 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7830 __pyx_r = __pyx_v_f;
7843 __Pyx_XDECREF(__pyx_t_1);
7844 __Pyx_XDECREF(__pyx_t_3);
7845 __Pyx_XDECREF(__pyx_t_4);
7846 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7849 __Pyx_XDECREF((PyObject *)__pyx_v_child);
7850 __Pyx_XDECREF(__pyx_v_fields);
7851 __Pyx_XDECREF(__pyx_v_childname);
7852 __Pyx_XDECREF(__pyx_v_new_offset);
7853 __Pyx_XDECREF(__pyx_v_t);
7854 __Pyx_RefNannyFinishContext();
7866 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7867 PyObject *__pyx_v_baseptr;
7868 __Pyx_RefNannyDeclarations
7871 __Pyx_RefNannySetupContext(
"set_array_base", 0);
7880 __pyx_t_1 = (__pyx_v_base == Py_None);
7881 __pyx_t_2 = (__pyx_t_1 != 0);
7891 __pyx_v_baseptr = NULL;
7911 Py_INCREF(__pyx_v_base);
7920 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
7931 Py_XDECREF(__pyx_v_arr->base);
7940 __pyx_v_arr->base = __pyx_v_baseptr;
7951 __Pyx_RefNannyFinishContext();
7962 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7963 PyObject *__pyx_r = NULL;
7964 __Pyx_RefNannyDeclarations
7966 __Pyx_RefNannySetupContext(
"get_array_base", 0);
7975 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
7985 __Pyx_XDECREF(__pyx_r);
7986 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8006 __Pyx_XDECREF(__pyx_r);
8007 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
8008 __pyx_r = ((PyObject *)__pyx_v_arr->base);
8022 __Pyx_XGIVEREF(__pyx_r);
8023 __Pyx_RefNannyFinishContext();
8035 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
8037 __Pyx_RefNannyDeclarations
8038 PyObject *__pyx_t_1 = NULL;
8039 PyObject *__pyx_t_2 = NULL;
8040 PyObject *__pyx_t_3 = NULL;
8042 PyObject *__pyx_t_5 = NULL;
8043 PyObject *__pyx_t_6 = NULL;
8044 PyObject *__pyx_t_7 = NULL;
8045 PyObject *__pyx_t_8 = NULL;
8046 __Pyx_RefNannySetupContext(
"import_array", 0);
8056 __Pyx_PyThreadState_declare
8057 __Pyx_PyThreadState_assign
8058 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8059 __Pyx_XGOTREF(__pyx_t_1);
8060 __Pyx_XGOTREF(__pyx_t_2);
8061 __Pyx_XGOTREF(__pyx_t_3);
8071 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 998, __pyx_L3_error)
8081 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8082 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8083 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8084 goto __pyx_L8_try_end;
8094 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8096 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8097 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 999, __pyx_L5_except_error)
8098 __Pyx_GOTREF(__pyx_t_5);
8099 __Pyx_GOTREF(__pyx_t_6);
8100 __Pyx_GOTREF(__pyx_t_7);
8109 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1000, __pyx_L5_except_error)
8110 __Pyx_GOTREF(__pyx_t_8);
8111 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8112 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8113 __PYX_ERR(2, 1000, __pyx_L5_except_error)
8115 goto __pyx_L5_except_error;
8116 __pyx_L5_except_error:;
8125 __Pyx_XGIVEREF(__pyx_t_1);
8126 __Pyx_XGIVEREF(__pyx_t_2);
8127 __Pyx_XGIVEREF(__pyx_t_3);
8128 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8129 goto __pyx_L1_error;
8145 __Pyx_XDECREF(__pyx_t_5);
8146 __Pyx_XDECREF(__pyx_t_6);
8147 __Pyx_XDECREF(__pyx_t_7);
8148 __Pyx_XDECREF(__pyx_t_8);
8149 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8152 __Pyx_RefNannyFinishContext();
8164 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
8166 __Pyx_RefNannyDeclarations
8167 PyObject *__pyx_t_1 = NULL;
8168 PyObject *__pyx_t_2 = NULL;
8169 PyObject *__pyx_t_3 = NULL;
8171 PyObject *__pyx_t_5 = NULL;
8172 PyObject *__pyx_t_6 = NULL;
8173 PyObject *__pyx_t_7 = NULL;
8174 PyObject *__pyx_t_8 = NULL;
8175 __Pyx_RefNannySetupContext(
"import_umath", 0);
8185 __Pyx_PyThreadState_declare
8186 __Pyx_PyThreadState_assign
8187 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8188 __Pyx_XGOTREF(__pyx_t_1);
8189 __Pyx_XGOTREF(__pyx_t_2);
8190 __Pyx_XGOTREF(__pyx_t_3);
8200 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1004, __pyx_L3_error)
8210 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8211 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8212 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8213 goto __pyx_L8_try_end;
8223 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8225 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8226 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1005, __pyx_L5_except_error)
8227 __Pyx_GOTREF(__pyx_t_5);
8228 __Pyx_GOTREF(__pyx_t_6);
8229 __Pyx_GOTREF(__pyx_t_7);
8238 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1006, __pyx_L5_except_error)
8239 __Pyx_GOTREF(__pyx_t_8);
8240 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8241 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8242 __PYX_ERR(2, 1006, __pyx_L5_except_error)
8244 goto __pyx_L5_except_error;
8245 __pyx_L5_except_error:;
8254 __Pyx_XGIVEREF(__pyx_t_1);
8255 __Pyx_XGIVEREF(__pyx_t_2);
8256 __Pyx_XGIVEREF(__pyx_t_3);
8257 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8258 goto __pyx_L1_error;
8274 __Pyx_XDECREF(__pyx_t_5);
8275 __Pyx_XDECREF(__pyx_t_6);
8276 __Pyx_XDECREF(__pyx_t_7);
8277 __Pyx_XDECREF(__pyx_t_8);
8278 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8281 __Pyx_RefNannyFinishContext();
8293 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
8295 __Pyx_RefNannyDeclarations
8296 PyObject *__pyx_t_1 = NULL;
8297 PyObject *__pyx_t_2 = NULL;
8298 PyObject *__pyx_t_3 = NULL;
8300 PyObject *__pyx_t_5 = NULL;
8301 PyObject *__pyx_t_6 = NULL;
8302 PyObject *__pyx_t_7 = NULL;
8303 PyObject *__pyx_t_8 = NULL;
8304 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
8314 __Pyx_PyThreadState_declare
8315 __Pyx_PyThreadState_assign
8316 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8317 __Pyx_XGOTREF(__pyx_t_1);
8318 __Pyx_XGOTREF(__pyx_t_2);
8319 __Pyx_XGOTREF(__pyx_t_3);
8329 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1010, __pyx_L3_error)
8339 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8340 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8341 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8342 goto __pyx_L8_try_end;
8351 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8353 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8354 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1011, __pyx_L5_except_error)
8355 __Pyx_GOTREF(__pyx_t_5);
8356 __Pyx_GOTREF(__pyx_t_6);
8357 __Pyx_GOTREF(__pyx_t_7);
8364 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1012, __pyx_L5_except_error)
8365 __Pyx_GOTREF(__pyx_t_8);
8366 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8367 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8368 __PYX_ERR(2, 1012, __pyx_L5_except_error)
8370 goto __pyx_L5_except_error;
8371 __pyx_L5_except_error:;
8380 __Pyx_XGIVEREF(__pyx_t_1);
8381 __Pyx_XGIVEREF(__pyx_t_2);
8382 __Pyx_XGIVEREF(__pyx_t_3);
8383 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8384 goto __pyx_L1_error;
8400 __Pyx_XDECREF(__pyx_t_5);
8401 __Pyx_XDECREF(__pyx_t_6);
8402 __Pyx_XDECREF(__pyx_t_7);
8403 __Pyx_XDECREF(__pyx_t_8);
8404 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8407 __Pyx_RefNannyFinishContext();
8420 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8421 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8422 PyObject *__pyx_v_shape = 0;
8423 Py_ssize_t __pyx_v_itemsize;
8424 PyObject *__pyx_v_format = 0;
8425 PyObject *__pyx_v_mode = 0;
8426 int __pyx_v_allocate_buffer;
8428 __Pyx_RefNannyDeclarations
8429 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
8431 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8432 PyObject* values[5] = {0,0,0,0,0};
8433 values[3] = ((PyObject *)__pyx_n_s_c);
8434 if (unlikely(__pyx_kwds)) {
8436 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8438 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8440 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8442 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8444 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8446 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8449 default:
goto __pyx_L5_argtuple_error;
8451 kw_args = PyDict_Size(__pyx_kwds);
8454 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8455 else goto __pyx_L5_argtuple_error;
8458 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8460 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 121, __pyx_L3_error)
8464 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8466 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 121, __pyx_L3_error)
8471 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8472 if (value) { values[3] = value; kw_args--; }
8477 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8478 if (value) { values[4] = value; kw_args--; }
8481 if (unlikely(kw_args > 0)) {
8482 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 121, __pyx_L3_error)
8485 switch (PyTuple_GET_SIZE(__pyx_args)) {
8486 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8488 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8490 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8491 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8492 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8494 default:
goto __pyx_L5_argtuple_error;
8497 __pyx_v_shape = ((PyObject*)values[0]);
8498 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
8499 __pyx_v_format = values[2];
8500 __pyx_v_mode = values[3];
8502 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8512 __pyx_v_allocate_buffer = ((int)1);
8515 goto __pyx_L4_argument_unpacking_done;
8516 __pyx_L5_argtuple_error:;
8517 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 121, __pyx_L3_error)
8519 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8520 __Pyx_RefNannyFinishContext();
8522 __pyx_L4_argument_unpacking_done:;
8523 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 121, __pyx_L1_error)
8524 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8525 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 121, __pyx_L1_error)
8527 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8542 __Pyx_RefNannyFinishContext();
8546 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
8548 Py_ssize_t __pyx_v_i;
8549 Py_ssize_t __pyx_v_dim;
8550 PyObject **__pyx_v_p;
8553 __Pyx_RefNannyDeclarations
8554 Py_ssize_t __pyx_t_1;
8556 PyObject *__pyx_t_3 = NULL;
8558 PyObject *__pyx_t_5 = NULL;
8561 Py_ssize_t __pyx_t_8;
8562 PyObject *__pyx_t_9 = NULL;
8563 PyObject *__pyx_t_10 = NULL;
8564 Py_ssize_t __pyx_t_11;
8565 __Pyx_RefNannySetupContext(
"__cinit__", 0);
8566 __Pyx_INCREF(__pyx_v_format);
8575 if (unlikely(__pyx_v_shape == Py_None)) {
8576 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
8577 __PYX_ERR(1, 128, __pyx_L1_error)
8579 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 128, __pyx_L1_error)
8580 __pyx_v_self->ndim = ((int)__pyx_t_1);
8589 __pyx_v_self->itemsize = __pyx_v_itemsize;
8598 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8599 if (unlikely(__pyx_t_2)) {
8608 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 132, __pyx_L1_error)
8609 __Pyx_GOTREF(__pyx_t_3);
8610 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8611 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8612 __PYX_ERR(1, 132, __pyx_L1_error)
8630 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8631 if (unlikely(__pyx_t_2)) {
8640 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 135, __pyx_L1_error)
8641 __Pyx_GOTREF(__pyx_t_3);
8642 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8643 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8644 __PYX_ERR(1, 135, __pyx_L1_error)
8662 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8663 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8673 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 138, __pyx_L1_error)
8674 __Pyx_GOTREF(__pyx_t_3);
8675 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 138, __pyx_L1_error)
8676 __Pyx_GOTREF(__pyx_t_5);
8677 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8678 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
8697 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 139, __pyx_L1_error)
8698 __pyx_t_5 = __pyx_v_format;
8699 __Pyx_INCREF(__pyx_t_5);
8700 __Pyx_GIVEREF(__pyx_t_5);
8701 __Pyx_GOTREF(__pyx_v_self->_format);
8702 __Pyx_DECREF(__pyx_v_self->_format);
8703 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
8713 if (unlikely(__pyx_v_self->_format == Py_None)) {
8714 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
8715 __PYX_ERR(1, 140, __pyx_L1_error)
8717 __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 140, __pyx_L1_error)
8718 __pyx_v_self->format = __pyx_t_6;
8727 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8736 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8745 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8746 if (unlikely(__pyx_t_4)) {
8755 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
8756 __Pyx_GOTREF(__pyx_t_5);
8757 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
8758 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8759 __PYX_ERR(1, 147, __pyx_L1_error)
8778 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
8780 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
8781 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8782 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 150, __pyx_L1_error)
8784 __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 150, __pyx_L1_error)
8785 __Pyx_GOTREF(__pyx_t_3);
8787 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 150, __pyx_L1_error)
8788 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8789 __pyx_v_dim = __pyx_t_8;
8790 __pyx_v_idx = __pyx_t_7;
8791 __pyx_t_7 = (__pyx_t_7 + 1);
8800 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8801 if (unlikely(__pyx_t_4)) {
8810 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error)
8811 __Pyx_GOTREF(__pyx_t_3);
8812 __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
8813 __Pyx_GOTREF(__pyx_t_9);
8814 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
8815 __Pyx_GOTREF(__pyx_t_10);
8816 __Pyx_GIVEREF(__pyx_t_3);
8817 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
8818 __Pyx_GIVEREF(__pyx_t_9);
8819 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
8822 __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
8823 __Pyx_GOTREF(__pyx_t_9);
8824 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8825 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
8826 __Pyx_GOTREF(__pyx_t_10);
8827 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8828 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8829 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8830 __PYX_ERR(1, 152, __pyx_L1_error)
8848 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8858 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8867 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 156, __pyx_L1_error)
8877 __pyx_v_order =
'F';
8886 __Pyx_INCREF(__pyx_n_u_fortran);
8887 __Pyx_GIVEREF(__pyx_n_u_fortran);
8888 __Pyx_GOTREF(__pyx_v_self->mode);
8889 __Pyx_DECREF(__pyx_v_self->mode);
8890 __pyx_v_self->mode = __pyx_n_u_fortran;
8909 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 159, __pyx_L1_error)
8910 if (likely(__pyx_t_4)) {
8919 __pyx_v_order =
'C';
8928 __Pyx_INCREF(__pyx_n_u_c);
8929 __Pyx_GIVEREF(__pyx_n_u_c);
8930 __Pyx_GOTREF(__pyx_v_self->mode);
8931 __Pyx_DECREF(__pyx_v_self->mode);
8932 __pyx_v_self->mode = __pyx_n_u_c;
8952 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
8953 __Pyx_GOTREF(__pyx_t_5);
8954 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 163, __pyx_L1_error)
8955 __Pyx_GOTREF(__pyx_t_10);
8956 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8957 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8958 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8959 __PYX_ERR(1, 163, __pyx_L1_error)
8970 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8979 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8988 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 169, __pyx_L1_error)
8989 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 169, __pyx_L1_error)
8990 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8991 __pyx_v_self->dtype_is_object = __pyx_t_4;
9000 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9010 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
9019 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9020 if (unlikely(__pyx_t_4)) {
9029 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 175, __pyx_L1_error)
9030 __Pyx_GOTREF(__pyx_t_10);
9031 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9032 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9033 __PYX_ERR(1, 175, __pyx_L1_error)
9051 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9061 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9070 if (unlikely(__pyx_v_itemsize == 0)) {
9071 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
9072 __PYX_ERR(1, 179, __pyx_L1_error)
9074 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9075 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
9076 __PYX_ERR(1, 179, __pyx_L1_error)
9078 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9079 __pyx_t_8 = __pyx_t_1;
9080 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
9081 __pyx_v_i = __pyx_t_11;
9090 (__pyx_v_p[__pyx_v_i]) = Py_None;
9132 __Pyx_XDECREF(__pyx_t_3);
9133 __Pyx_XDECREF(__pyx_t_5);
9134 __Pyx_XDECREF(__pyx_t_9);
9135 __Pyx_XDECREF(__pyx_t_10);
9136 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9139 __Pyx_XDECREF(__pyx_v_format);
9140 __Pyx_RefNannyFinishContext();
9153 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
9154 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
9156 __Pyx_RefNannyDeclarations
9157 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
9158 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
9161 __Pyx_RefNannyFinishContext();
9165 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
9166 int __pyx_v_bufmode;
9168 __Pyx_RefNannyDeclarations
9171 PyObject *__pyx_t_3 = NULL;
9173 Py_ssize_t __pyx_t_5;
9175 Py_ssize_t *__pyx_t_7;
9176 if (__pyx_v_info == NULL) {
9177 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
9180 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
9181 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9182 __Pyx_GIVEREF(__pyx_v_info->obj);
9191 __pyx_v_bufmode = -1;
9200 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 186, __pyx_L1_error)
9201 __pyx_t_2 = (__pyx_t_1 != 0);
9211 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9230 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
9231 __pyx_t_1 = (__pyx_t_2 != 0);
9241 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9260 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9261 if (unlikely(__pyx_t_1)) {
9270 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 191, __pyx_L1_error)
9271 __Pyx_GOTREF(__pyx_t_3);
9272 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9273 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9274 __PYX_ERR(1, 191, __pyx_L1_error)
9292 __pyx_t_4 = __pyx_v_self->data;
9293 __pyx_v_info->buf = __pyx_t_4;
9302 __pyx_t_5 = __pyx_v_self->len;
9303 __pyx_v_info->len = __pyx_t_5;
9312 __pyx_t_6 = __pyx_v_self->ndim;
9313 __pyx_v_info->ndim = __pyx_t_6;
9322 __pyx_t_7 = __pyx_v_self->_shape;
9323 __pyx_v_info->shape = __pyx_t_7;
9332 __pyx_t_7 = __pyx_v_self->_strides;
9333 __pyx_v_info->strides = __pyx_t_7;
9342 __pyx_v_info->suboffsets = NULL;
9351 __pyx_t_5 = __pyx_v_self->itemsize;
9352 __pyx_v_info->itemsize = __pyx_t_5;
9361 __pyx_v_info->readonly = 0;
9370 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9380 __pyx_t_4 = __pyx_v_self->format;
9381 __pyx_v_info->format = __pyx_t_4;
9401 __pyx_v_info->format = NULL;
9412 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9413 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9414 __Pyx_GOTREF(__pyx_v_info->obj);
9415 __Pyx_DECREF(__pyx_v_info->obj);
9416 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9430 __Pyx_XDECREF(__pyx_t_3);
9431 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9433 if (__pyx_v_info->obj != NULL) {
9434 __Pyx_GOTREF(__pyx_v_info->obj);
9435 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9439 if (__pyx_v_info->obj == Py_None) {
9440 __Pyx_GOTREF(__pyx_v_info->obj);
9441 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9444 __Pyx_RefNannyFinishContext();
9457 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
9458 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9459 __Pyx_RefNannyDeclarations
9460 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9461 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
9464 __Pyx_RefNannyFinishContext();
9467 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
9468 __Pyx_RefNannyDeclarations
9470 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9479 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9489 __pyx_v_self->callback_free_data(__pyx_v_self->data);
9508 __pyx_t_1 = (__pyx_v_self->free_data != 0);
9518 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9528 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9546 free(__pyx_v_self->data);
9565 PyObject_Free(__pyx_v_self->_shape);
9576 __Pyx_RefNannyFinishContext();
9588 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
9589 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9590 PyObject *__pyx_r = 0;
9591 __Pyx_RefNannyDeclarations
9592 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
9593 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
9596 __Pyx_RefNannyFinishContext();
9600 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
9601 PyObject *__pyx_r = NULL;
9602 __Pyx_RefNannyDeclarations
9603 PyObject *__pyx_t_1 = NULL;
9604 __Pyx_RefNannySetupContext(
"__get__", 0);
9613 __Pyx_XDECREF(__pyx_r);
9614 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error)
9615 __Pyx_GOTREF(__pyx_t_1);
9616 __pyx_r = __pyx_t_1;
9630 __Pyx_XDECREF(__pyx_t_1);
9631 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9634 __Pyx_XGIVEREF(__pyx_r);
9635 __Pyx_RefNannyFinishContext();
9647 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
9649 PyObject *__pyx_r = NULL;
9650 __Pyx_RefNannyDeclarations
9651 PyObject *__pyx_t_1 = NULL;
9652 PyObject *__pyx_t_2 = NULL;
9653 PyObject *__pyx_t_3 = NULL;
9654 __Pyx_RefNannySetupContext(
"get_memview", 0);
9663 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9672 __Pyx_XDECREF(__pyx_r);
9673 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error)
9674 __Pyx_GOTREF(__pyx_t_1);
9675 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
9676 __Pyx_GOTREF(__pyx_t_2);
9677 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 227, __pyx_L1_error)
9678 __Pyx_GOTREF(__pyx_t_3);
9679 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9680 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9681 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9682 __Pyx_GIVEREF(__pyx_t_1);
9683 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9684 __Pyx_GIVEREF(__pyx_t_2);
9685 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9688 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
9689 __Pyx_GOTREF(__pyx_t_2);
9690 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9691 __pyx_r = __pyx_t_2;
9705 __Pyx_XDECREF(__pyx_t_1);
9706 __Pyx_XDECREF(__pyx_t_2);
9707 __Pyx_XDECREF(__pyx_t_3);
9708 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9711 __Pyx_XGIVEREF(__pyx_r);
9712 __Pyx_RefNannyFinishContext();
9725 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
9726 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9728 __Pyx_RefNannyDeclarations
9729 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
9730 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
9733 __Pyx_RefNannyFinishContext();
9737 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
9739 __Pyx_RefNannyDeclarations
9740 __Pyx_RefNannySetupContext(
"__len__", 0);
9749 __pyx_r = (__pyx_v_self->_shape[0]);
9762 __Pyx_RefNannyFinishContext();
9775 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
9776 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9777 PyObject *__pyx_r = 0;
9778 __Pyx_RefNannyDeclarations
9779 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
9780 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9783 __Pyx_RefNannyFinishContext();
9787 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9788 PyObject *__pyx_r = NULL;
9789 __Pyx_RefNannyDeclarations
9790 PyObject *__pyx_t_1 = NULL;
9791 PyObject *__pyx_t_2 = NULL;
9792 __Pyx_RefNannySetupContext(
"__getattr__", 0);
9801 __Pyx_XDECREF(__pyx_r);
9802 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
9803 __Pyx_GOTREF(__pyx_t_1);
9804 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error)
9805 __Pyx_GOTREF(__pyx_t_2);
9806 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9807 __pyx_r = __pyx_t_2;
9821 __Pyx_XDECREF(__pyx_t_1);
9822 __Pyx_XDECREF(__pyx_t_2);
9823 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9826 __Pyx_XGIVEREF(__pyx_r);
9827 __Pyx_RefNannyFinishContext();
9840 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
9841 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9842 PyObject *__pyx_r = 0;
9843 __Pyx_RefNannyDeclarations
9844 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
9845 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9848 __Pyx_RefNannyFinishContext();
9852 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9853 PyObject *__pyx_r = NULL;
9854 __Pyx_RefNannyDeclarations
9855 PyObject *__pyx_t_1 = NULL;
9856 PyObject *__pyx_t_2 = NULL;
9857 __Pyx_RefNannySetupContext(
"__getitem__", 0);
9866 __Pyx_XDECREF(__pyx_r);
9867 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
9868 __Pyx_GOTREF(__pyx_t_1);
9869 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 236, __pyx_L1_error)
9870 __Pyx_GOTREF(__pyx_t_2);
9871 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9872 __pyx_r = __pyx_t_2;
9886 __Pyx_XDECREF(__pyx_t_1);
9887 __Pyx_XDECREF(__pyx_t_2);
9888 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9891 __Pyx_XGIVEREF(__pyx_r);
9892 __Pyx_RefNannyFinishContext();
9905 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
9906 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9908 __Pyx_RefNannyDeclarations
9909 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
9910 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9913 __Pyx_RefNannyFinishContext();
9917 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9919 __Pyx_RefNannyDeclarations
9920 PyObject *__pyx_t_1 = NULL;
9921 __Pyx_RefNannySetupContext(
"__setitem__", 0);
9930 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 239, __pyx_L1_error)
9931 __Pyx_GOTREF(__pyx_t_1);
9932 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 239, __pyx_L1_error)
9933 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9947 __Pyx_XDECREF(__pyx_t_1);
9948 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9951 __Pyx_RefNannyFinishContext();
9962 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9963 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9964 PyObject *__pyx_r = 0;
9965 __Pyx_RefNannyDeclarations
9966 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9967 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
9970 __Pyx_RefNannyFinishContext();
9974 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
9975 PyObject *__pyx_r = NULL;
9976 __Pyx_RefNannyDeclarations
9977 PyObject *__pyx_t_1 = NULL;
9978 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9986 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9987 __Pyx_GOTREF(__pyx_t_1);
9988 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9989 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9990 __PYX_ERR(1, 2, __pyx_L1_error)
10000 __Pyx_XDECREF(__pyx_t_1);
10001 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10003 __Pyx_XGIVEREF(__pyx_r);
10004 __Pyx_RefNannyFinishContext();
10016 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10017 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10018 PyObject *__pyx_r = 0;
10019 __Pyx_RefNannyDeclarations
10020 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10021 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10024 __Pyx_RefNannyFinishContext();
10028 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10029 PyObject *__pyx_r = NULL;
10030 __Pyx_RefNannyDeclarations
10031 PyObject *__pyx_t_1 = NULL;
10032 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10039 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10040 __Pyx_GOTREF(__pyx_t_1);
10041 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10043 __PYX_ERR(1, 4, __pyx_L1_error)
10054 __Pyx_XDECREF(__pyx_t_1);
10055 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10057 __Pyx_XGIVEREF(__pyx_r);
10058 __Pyx_RefNannyFinishContext();
10070 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
10071 struct __pyx_array_obj *__pyx_v_result = 0;
10072 struct __pyx_array_obj *__pyx_r = NULL;
10073 __Pyx_RefNannyDeclarations
10075 PyObject *__pyx_t_2 = NULL;
10076 PyObject *__pyx_t_3 = NULL;
10077 PyObject *__pyx_t_4 = NULL;
10078 PyObject *__pyx_t_5 = NULL;
10079 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
10088 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10098 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
10099 __Pyx_GOTREF(__pyx_t_2);
10100 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
10101 __Pyx_GOTREF(__pyx_t_3);
10102 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
10103 __Pyx_GOTREF(__pyx_t_4);
10104 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 248, __pyx_L1_error)
10105 __Pyx_GOTREF(__pyx_t_5);
10106 __Pyx_INCREF(__pyx_v_shape);
10107 __Pyx_GIVEREF(__pyx_v_shape);
10108 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10109 __Pyx_GIVEREF(__pyx_t_2);
10110 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10111 __Pyx_GIVEREF(__pyx_t_3);
10112 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10113 __Pyx_GIVEREF(__pyx_t_4);
10114 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10118 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
10119 __Pyx_GOTREF(__pyx_t_4);
10120 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10121 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
10142 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
10143 __Pyx_GOTREF(__pyx_t_4);
10144 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
10145 __Pyx_GOTREF(__pyx_t_5);
10146 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
10147 __Pyx_GOTREF(__pyx_t_3);
10148 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
10149 __Pyx_GOTREF(__pyx_t_2);
10150 __Pyx_INCREF(__pyx_v_shape);
10151 __Pyx_GIVEREF(__pyx_v_shape);
10152 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10153 __Pyx_GIVEREF(__pyx_t_4);
10154 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10155 __Pyx_GIVEREF(__pyx_t_5);
10156 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10157 __Pyx_GIVEREF(__pyx_t_3);
10158 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10170 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
10171 __Pyx_GOTREF(__pyx_t_3);
10172 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 251, __pyx_L1_error)
10181 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
10182 __Pyx_GOTREF(__pyx_t_5);
10183 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10184 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10185 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
10195 __pyx_v_result->data = __pyx_v_buf;
10206 __Pyx_XDECREF(((PyObject *)__pyx_r));
10207 __Pyx_INCREF(((PyObject *)__pyx_v_result));
10208 __pyx_r = __pyx_v_result;
10221 __Pyx_XDECREF(__pyx_t_2);
10222 __Pyx_XDECREF(__pyx_t_3);
10223 __Pyx_XDECREF(__pyx_t_4);
10224 __Pyx_XDECREF(__pyx_t_5);
10225 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10228 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10229 __Pyx_XGIVEREF((PyObject *)__pyx_r);
10230 __Pyx_RefNannyFinishContext();
10243 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10244 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10245 PyObject *__pyx_v_name = 0;
10247 __Pyx_RefNannyDeclarations
10248 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
10250 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10251 PyObject* values[1] = {0};
10252 if (unlikely(__pyx_kwds)) {
10253 Py_ssize_t kw_args;
10254 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10255 switch (pos_args) {
10256 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10257 CYTHON_FALLTHROUGH;
10259 default:
goto __pyx_L5_argtuple_error;
10261 kw_args = PyDict_Size(__pyx_kwds);
10262 switch (pos_args) {
10264 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10265 else goto __pyx_L5_argtuple_error;
10267 if (unlikely(kw_args > 0)) {
10268 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 280, __pyx_L3_error)
10270 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10271 goto __pyx_L5_argtuple_error;
10273 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10275 __pyx_v_name = values[0];
10277 goto __pyx_L4_argument_unpacking_done;
10278 __pyx_L5_argtuple_error:;
10279 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 280, __pyx_L3_error)
10281 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10282 __Pyx_RefNannyFinishContext();
10284 __pyx_L4_argument_unpacking_done:;
10285 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10288 __Pyx_RefNannyFinishContext();
10292 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10294 __Pyx_RefNannyDeclarations
10295 __Pyx_RefNannySetupContext(
"__init__", 0);
10304 __Pyx_INCREF(__pyx_v_name);
10305 __Pyx_GIVEREF(__pyx_v_name);
10306 __Pyx_GOTREF(__pyx_v_self->name);
10307 __Pyx_DECREF(__pyx_v_self->name);
10308 __pyx_v_self->name = __pyx_v_name;
10320 __Pyx_RefNannyFinishContext();
10333 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
10334 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10335 PyObject *__pyx_r = 0;
10336 __Pyx_RefNannyDeclarations
10337 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10338 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10341 __Pyx_RefNannyFinishContext();
10345 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10346 PyObject *__pyx_r = NULL;
10347 __Pyx_RefNannyDeclarations
10348 __Pyx_RefNannySetupContext(
"__repr__", 0);
10357 __Pyx_XDECREF(__pyx_r);
10358 __Pyx_INCREF(__pyx_v_self->name);
10359 __pyx_r = __pyx_v_self->name;
10372 __Pyx_XGIVEREF(__pyx_r);
10373 __Pyx_RefNannyFinishContext();
10384 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10385 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10386 PyObject *__pyx_r = 0;
10387 __Pyx_RefNannyDeclarations
10388 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10389 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10392 __Pyx_RefNannyFinishContext();
10396 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10397 int __pyx_v_use_setstate;
10398 PyObject *__pyx_v_state = NULL;
10399 PyObject *__pyx_v__dict = NULL;
10400 PyObject *__pyx_r = NULL;
10401 __Pyx_RefNannyDeclarations
10402 PyObject *__pyx_t_1 = NULL;
10405 PyObject *__pyx_t_4 = NULL;
10406 PyObject *__pyx_t_5 = NULL;
10407 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10416 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
10417 __Pyx_GOTREF(__pyx_t_1);
10418 __Pyx_INCREF(__pyx_v_self->name);
10419 __Pyx_GIVEREF(__pyx_v_self->name);
10420 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10421 __pyx_v_state = ((PyObject*)__pyx_t_1);
10431 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10432 __Pyx_GOTREF(__pyx_t_1);
10433 __pyx_v__dict = __pyx_t_1;
10443 __pyx_t_2 = (__pyx_v__dict != Py_None);
10444 __pyx_t_3 = (__pyx_t_2 != 0);
10454 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10455 __Pyx_GOTREF(__pyx_t_1);
10456 __Pyx_INCREF(__pyx_v__dict);
10457 __Pyx_GIVEREF(__pyx_v__dict);
10458 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10459 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
10460 __Pyx_GOTREF(__pyx_t_4);
10461 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10462 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10472 __pyx_v_use_setstate = 1;
10492 __pyx_t_3 = (__pyx_v_self->name != Py_None);
10493 __pyx_v_use_setstate = __pyx_t_3;
10504 __pyx_t_3 = (__pyx_v_use_setstate != 0);
10514 __Pyx_XDECREF(__pyx_r);
10515 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error)
10516 __Pyx_GOTREF(__pyx_t_4);
10517 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
10518 __Pyx_GOTREF(__pyx_t_1);
10519 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10520 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10521 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10522 __Pyx_INCREF(__pyx_int_184977713);
10523 __Pyx_GIVEREF(__pyx_int_184977713);
10524 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10525 __Pyx_INCREF(Py_None);
10526 __Pyx_GIVEREF(Py_None);
10527 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10528 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error)
10529 __Pyx_GOTREF(__pyx_t_5);
10530 __Pyx_GIVEREF(__pyx_t_4);
10531 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10532 __Pyx_GIVEREF(__pyx_t_1);
10533 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10534 __Pyx_INCREF(__pyx_v_state);
10535 __Pyx_GIVEREF(__pyx_v_state);
10536 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10539 __pyx_r = __pyx_t_5;
10560 __Pyx_XDECREF(__pyx_r);
10561 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10562 __Pyx_GOTREF(__pyx_t_5);
10563 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10564 __Pyx_GOTREF(__pyx_t_1);
10565 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10566 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10567 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10568 __Pyx_INCREF(__pyx_int_184977713);
10569 __Pyx_GIVEREF(__pyx_int_184977713);
10570 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10571 __Pyx_INCREF(__pyx_v_state);
10572 __Pyx_GIVEREF(__pyx_v_state);
10573 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10574 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10575 __Pyx_GOTREF(__pyx_t_4);
10576 __Pyx_GIVEREF(__pyx_t_5);
10577 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10578 __Pyx_GIVEREF(__pyx_t_1);
10579 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10582 __pyx_r = __pyx_t_4;
10595 __Pyx_XDECREF(__pyx_t_1);
10596 __Pyx_XDECREF(__pyx_t_4);
10597 __Pyx_XDECREF(__pyx_t_5);
10598 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10601 __Pyx_XDECREF(__pyx_v_state);
10602 __Pyx_XDECREF(__pyx_v__dict);
10603 __Pyx_XGIVEREF(__pyx_r);
10604 __Pyx_RefNannyFinishContext();
10616 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10617 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10618 PyObject *__pyx_r = 0;
10619 __Pyx_RefNannyDeclarations
10620 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10621 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10624 __Pyx_RefNannyFinishContext();
10628 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10629 PyObject *__pyx_r = NULL;
10630 __Pyx_RefNannyDeclarations
10631 PyObject *__pyx_t_1 = NULL;
10632 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10639 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
10640 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10641 __Pyx_GOTREF(__pyx_t_1);
10642 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10652 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10655 __Pyx_XDECREF(__pyx_t_1);
10656 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10659 __Pyx_XGIVEREF(__pyx_r);
10660 __Pyx_RefNannyFinishContext();
10672 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
10673 Py_intptr_t __pyx_v_aligned_p;
10674 size_t __pyx_v_offset;
10685 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10694 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10703 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10713 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10731 __pyx_r = ((
void *)__pyx_v_aligned_p);
10756 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10757 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10758 PyObject *__pyx_v_obj = 0;
10760 int __pyx_v_dtype_is_object;
10762 __Pyx_RefNannyDeclarations
10763 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
10765 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10766 PyObject* values[3] = {0,0,0};
10767 if (unlikely(__pyx_kwds)) {
10768 Py_ssize_t kw_args;
10769 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10770 switch (pos_args) {
10771 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10772 CYTHON_FALLTHROUGH;
10773 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10774 CYTHON_FALLTHROUGH;
10775 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10776 CYTHON_FALLTHROUGH;
10778 default:
goto __pyx_L5_argtuple_error;
10780 kw_args = PyDict_Size(__pyx_kwds);
10781 switch (pos_args) {
10783 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10784 else goto __pyx_L5_argtuple_error;
10785 CYTHON_FALLTHROUGH;
10787 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10789 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 344, __pyx_L3_error)
10791 CYTHON_FALLTHROUGH;
10794 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10795 if (value) { values[2] = value; kw_args--; }
10798 if (unlikely(kw_args > 0)) {
10799 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 344, __pyx_L3_error)
10802 switch (PyTuple_GET_SIZE(__pyx_args)) {
10803 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10804 CYTHON_FALLTHROUGH;
10805 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10806 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10808 default:
goto __pyx_L5_argtuple_error;
10811 __pyx_v_obj = values[0];
10812 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
10814 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
10816 __pyx_v_dtype_is_object = ((int)0);
10819 goto __pyx_L4_argument_unpacking_done;
10820 __pyx_L5_argtuple_error:;
10821 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 344, __pyx_L3_error)
10823 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10824 __Pyx_RefNannyFinishContext();
10826 __pyx_L4_argument_unpacking_done:;
10827 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10830 __Pyx_RefNannyFinishContext();
10834 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
10836 __Pyx_RefNannyDeclarations
10841 __Pyx_RefNannySetupContext(
"__cinit__", 0);
10850 __Pyx_INCREF(__pyx_v_obj);
10851 __Pyx_GIVEREF(__pyx_v_obj);
10852 __Pyx_GOTREF(__pyx_v_self->obj);
10853 __Pyx_DECREF(__pyx_v_self->obj);
10854 __pyx_v_self->obj = __pyx_v_obj;
10863 __pyx_v_self->flags = __pyx_v_flags;
10872 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10873 __pyx_t_3 = (__pyx_t_2 != 0);
10876 __pyx_t_1 = __pyx_t_3;
10877 goto __pyx_L4_bool_binop_done;
10879 __pyx_t_3 = (__pyx_v_obj != Py_None);
10880 __pyx_t_2 = (__pyx_t_3 != 0);
10881 __pyx_t_1 = __pyx_t_2;
10882 __pyx_L4_bool_binop_done:;
10892 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 348, __pyx_L1_error)
10901 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10911 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10920 Py_INCREF(Py_None);
10947 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10957 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10966 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10984 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10994 __pyx_v_self->lock = PyThread_allocate_lock();
11003 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11004 if (unlikely(__pyx_t_1)) {
11013 PyErr_NoMemory(); __PYX_ERR(1, 360, __pyx_L1_error)
11040 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11050 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
11053 __pyx_t_1 = __pyx_t_2;
11054 goto __pyx_L11_bool_binop_done;
11056 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
11057 __pyx_t_1 = __pyx_t_2;
11058 __pyx_L11_bool_binop_done:;
11059 __pyx_v_self->dtype_is_object = __pyx_t_1;
11079 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11090 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
11099 __pyx_v_self->typeinfo = NULL;
11113 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11116 __Pyx_RefNannyFinishContext();
11129 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
11130 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11131 __Pyx_RefNannyDeclarations
11132 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
11133 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11136 __Pyx_RefNannyFinishContext();
11139 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11141 __Pyx_RefNannyDeclarations
11147 PyThread_type_lock __pyx_t_6;
11148 PyThread_type_lock __pyx_t_7;
11149 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
11158 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11159 __pyx_t_2 = (__pyx_t_1 != 0);
11169 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11187 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11197 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11198 __pyx_t_4 = __pyx_t_3;
11199 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11200 __pyx_v_i = __pyx_t_5;
11209 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11219 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11228 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11238 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11239 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11248 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11249 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11267 goto __pyx_L6_break;
11287 PyThread_free_lock(__pyx_v_self->lock);
11309 __Pyx_RefNannyFinishContext();
11320 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11321 Py_ssize_t __pyx_v_dim;
11322 char *__pyx_v_itemp;
11323 PyObject *__pyx_v_idx = NULL;
11325 __Pyx_RefNannyDeclarations
11326 Py_ssize_t __pyx_t_1;
11327 PyObject *__pyx_t_2 = NULL;
11328 Py_ssize_t __pyx_t_3;
11329 PyObject *(*__pyx_t_4)(PyObject *);
11330 PyObject *__pyx_t_5 = NULL;
11331 Py_ssize_t __pyx_t_6;
11333 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
11342 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
11352 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11353 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11356 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 392, __pyx_L1_error)
11357 __Pyx_GOTREF(__pyx_t_2);
11358 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 392, __pyx_L1_error)
11361 if (likely(!__pyx_t_4)) {
11362 if (likely(PyList_CheckExact(__pyx_t_2))) {
11363 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
11364 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11365 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
11367 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
11368 __Pyx_GOTREF(__pyx_t_5);
11371 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
11372 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11373 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
11375 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
11376 __Pyx_GOTREF(__pyx_t_5);
11380 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11381 if (unlikely(!__pyx_t_5)) {
11382 PyObject* exc_type = PyErr_Occurred();
11384 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11385 else __PYX_ERR(1, 392, __pyx_L1_error)
11389 __Pyx_GOTREF(__pyx_t_5);
11391 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11393 __pyx_v_dim = __pyx_t_1;
11394 __pyx_t_1 = (__pyx_t_1 + 1);
11403 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 393, __pyx_L1_error)
11404 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 393, __pyx_L1_error)
11405 __pyx_v_itemp = __pyx_t_7;
11415 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11424 __pyx_r = __pyx_v_itemp;
11437 __Pyx_XDECREF(__pyx_t_2);
11438 __Pyx_XDECREF(__pyx_t_5);
11439 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11442 __Pyx_XDECREF(__pyx_v_idx);
11443 __Pyx_RefNannyFinishContext();
11456 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
11457 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11458 PyObject *__pyx_r = 0;
11459 __Pyx_RefNannyDeclarations
11460 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
11461 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11464 __Pyx_RefNannyFinishContext();
11468 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11469 PyObject *__pyx_v_have_slices = NULL;
11470 PyObject *__pyx_v_indices = NULL;
11471 char *__pyx_v_itemp;
11472 PyObject *__pyx_r = NULL;
11473 __Pyx_RefNannyDeclarations
11476 PyObject *__pyx_t_3 = NULL;
11477 PyObject *__pyx_t_4 = NULL;
11478 PyObject *__pyx_t_5 = NULL;
11480 __Pyx_RefNannySetupContext(
"__getitem__", 0);
11489 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11490 __pyx_t_2 = (__pyx_t_1 != 0);
11500 __Pyx_XDECREF(__pyx_r);
11501 __Pyx_INCREF(((PyObject *)__pyx_v_self));
11502 __pyx_r = ((PyObject *)__pyx_v_self);
11521 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 402, __pyx_L1_error)
11522 __Pyx_GOTREF(__pyx_t_3);
11523 if (likely(__pyx_t_3 != Py_None)) {
11524 PyObject* sequence = __pyx_t_3;
11525 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11526 if (unlikely(size != 2)) {
11527 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11528 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11529 __PYX_ERR(1, 402, __pyx_L1_error)
11531 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11532 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11533 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11534 __Pyx_INCREF(__pyx_t_4);
11535 __Pyx_INCREF(__pyx_t_5);
11537 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 402, __pyx_L1_error)
11538 __Pyx_GOTREF(__pyx_t_4);
11539 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 402, __pyx_L1_error)
11540 __Pyx_GOTREF(__pyx_t_5);
11542 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11544 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 402, __pyx_L1_error)
11546 __pyx_v_have_slices = __pyx_t_4;
11548 __pyx_v_indices = __pyx_t_5;
11558 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 405, __pyx_L1_error)
11568 __Pyx_XDECREF(__pyx_r);
11569 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error)
11570 __Pyx_GOTREF(__pyx_t_3);
11571 __pyx_r = __pyx_t_3;
11592 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 408, __pyx_L1_error)
11593 __pyx_v_itemp = __pyx_t_6;
11602 __Pyx_XDECREF(__pyx_r);
11603 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
11604 __Pyx_GOTREF(__pyx_t_3);
11605 __pyx_r = __pyx_t_3;
11620 __Pyx_XDECREF(__pyx_t_3);
11621 __Pyx_XDECREF(__pyx_t_4);
11622 __Pyx_XDECREF(__pyx_t_5);
11623 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11626 __Pyx_XDECREF(__pyx_v_have_slices);
11627 __Pyx_XDECREF(__pyx_v_indices);
11628 __Pyx_XGIVEREF(__pyx_r);
11629 __Pyx_RefNannyFinishContext();
11642 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
11643 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11645 __Pyx_RefNannyDeclarations
11646 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
11647 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11650 __Pyx_RefNannyFinishContext();
11654 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11655 PyObject *__pyx_v_have_slices = NULL;
11656 PyObject *__pyx_v_obj = NULL;
11658 __Pyx_RefNannyDeclarations
11660 PyObject *__pyx_t_2 = NULL;
11661 PyObject *__pyx_t_3 = NULL;
11662 PyObject *__pyx_t_4 = NULL;
11663 __Pyx_RefNannySetupContext(
"__setitem__", 0);
11664 __Pyx_INCREF(__pyx_v_index);
11673 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11674 if (unlikely(__pyx_t_1)) {
11683 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error)
11684 __Pyx_GOTREF(__pyx_t_2);
11685 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11686 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11687 __PYX_ERR(1, 413, __pyx_L1_error)
11705 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
11706 __Pyx_GOTREF(__pyx_t_2);
11707 if (likely(__pyx_t_2 != Py_None)) {
11708 PyObject* sequence = __pyx_t_2;
11709 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11710 if (unlikely(size != 2)) {
11711 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11712 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11713 __PYX_ERR(1, 415, __pyx_L1_error)
11715 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11716 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11717 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11718 __Pyx_INCREF(__pyx_t_3);
11719 __Pyx_INCREF(__pyx_t_4);
11721 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 415, __pyx_L1_error)
11722 __Pyx_GOTREF(__pyx_t_3);
11723 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 415, __pyx_L1_error)
11724 __Pyx_GOTREF(__pyx_t_4);
11726 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11728 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 415, __pyx_L1_error)
11730 __pyx_v_have_slices = __pyx_t_3;
11732 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11742 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 417, __pyx_L1_error)
11752 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11753 __Pyx_GOTREF(__pyx_t_2);
11754 __pyx_v_obj = __pyx_t_2;
11764 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 419, __pyx_L1_error)
11774 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11775 __Pyx_GOTREF(__pyx_t_2);
11776 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11777 __Pyx_GOTREF(__pyx_t_4);
11778 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11779 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11799 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
11800 __Pyx_GOTREF(__pyx_t_4);
11801 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 422, __pyx_L1_error)
11802 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
11803 __Pyx_GOTREF(__pyx_t_2);
11804 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11805 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11827 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
11828 __Pyx_GOTREF(__pyx_t_2);
11829 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11845 __Pyx_XDECREF(__pyx_t_2);
11846 __Pyx_XDECREF(__pyx_t_3);
11847 __Pyx_XDECREF(__pyx_t_4);
11848 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11851 __Pyx_XDECREF(__pyx_v_have_slices);
11852 __Pyx_XDECREF(__pyx_v_obj);
11853 __Pyx_XDECREF(__pyx_v_index);
11854 __Pyx_RefNannyFinishContext();
11866 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11867 PyObject *__pyx_r = NULL;
11868 __Pyx_RefNannyDeclarations
11871 PyObject *__pyx_t_3 = NULL;
11872 PyObject *__pyx_t_4 = NULL;
11873 PyObject *__pyx_t_5 = NULL;
11874 PyObject *__pyx_t_6 = NULL;
11875 PyObject *__pyx_t_7 = NULL;
11876 PyObject *__pyx_t_8 = NULL;
11878 __Pyx_RefNannySetupContext(
"is_slice", 0);
11879 __Pyx_INCREF(__pyx_v_obj);
11888 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11889 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11900 __Pyx_PyThreadState_declare
11901 __Pyx_PyThreadState_assign
11902 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11903 __Pyx_XGOTREF(__pyx_t_3);
11904 __Pyx_XGOTREF(__pyx_t_4);
11905 __Pyx_XGOTREF(__pyx_t_5);
11915 __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 429, __pyx_L4_error)
11916 __Pyx_GOTREF(__pyx_t_6);
11925 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
11926 __Pyx_GOTREF(__pyx_t_7);
11935 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 429, __pyx_L4_error)
11936 __Pyx_GOTREF(__pyx_t_8);
11937 __Pyx_INCREF(__pyx_v_obj);
11938 __Pyx_GIVEREF(__pyx_v_obj);
11939 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11940 __Pyx_GIVEREF(__pyx_t_6);
11941 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11942 __Pyx_GIVEREF(__pyx_t_7);
11943 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11946 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 429, __pyx_L4_error)
11947 __Pyx_GOTREF(__pyx_t_7);
11948 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11949 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11960 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11961 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11962 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11963 goto __pyx_L9_try_end;
11965 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11966 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11967 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11976 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11978 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11979 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 431, __pyx_L6_except_error)
11980 __Pyx_GOTREF(__pyx_t_7);
11981 __Pyx_GOTREF(__pyx_t_8);
11982 __Pyx_GOTREF(__pyx_t_6);
11991 __Pyx_XDECREF(__pyx_r);
11992 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11993 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11994 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11995 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11996 goto __pyx_L7_except_return;
11998 goto __pyx_L6_except_error;
11999 __pyx_L6_except_error:;
12008 __Pyx_XGIVEREF(__pyx_t_3);
12009 __Pyx_XGIVEREF(__pyx_t_4);
12010 __Pyx_XGIVEREF(__pyx_t_5);
12011 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12012 goto __pyx_L1_error;
12013 __pyx_L7_except_return:;
12014 __Pyx_XGIVEREF(__pyx_t_3);
12015 __Pyx_XGIVEREF(__pyx_t_4);
12016 __Pyx_XGIVEREF(__pyx_t_5);
12017 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12038 __Pyx_XDECREF(__pyx_r);
12039 __Pyx_INCREF(__pyx_v_obj);
12040 __pyx_r = __pyx_v_obj;
12053 __Pyx_XDECREF(__pyx_t_6);
12054 __Pyx_XDECREF(__pyx_t_7);
12055 __Pyx_XDECREF(__pyx_t_8);
12056 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12059 __Pyx_XDECREF(__pyx_v_obj);
12060 __Pyx_XGIVEREF(__pyx_r);
12061 __Pyx_RefNannyFinishContext();
12073 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12074 __Pyx_memviewslice __pyx_v_dst_slice;
12075 __Pyx_memviewslice __pyx_v_src_slice;
12076 PyObject *__pyx_r = NULL;
12077 __Pyx_RefNannyDeclarations
12078 PyObject *__pyx_t_1 = NULL;
12082 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
12091 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 440, __pyx_L1_error)
12100 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
12109 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
12110 __Pyx_GOTREF(__pyx_t_1);
12111 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
12112 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12113 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
12114 __Pyx_GOTREF(__pyx_t_1);
12115 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
12116 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12125 __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 440, __pyx_L1_error)
12136 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12139 __Pyx_XDECREF(__pyx_t_1);
12140 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12143 __Pyx_XGIVEREF(__pyx_r);
12144 __Pyx_RefNannyFinishContext();
12156 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12157 int __pyx_v_array[0x80];
12159 void *__pyx_v_item;
12160 __Pyx_memviewslice *__pyx_v_dst_slice;
12161 __Pyx_memviewslice __pyx_v_tmp_slice;
12162 PyObject *__pyx_r = NULL;
12163 __Pyx_RefNannyDeclarations
12165 PyObject *__pyx_t_2 = NULL;
12168 char const *__pyx_t_5;
12169 PyObject *__pyx_t_6 = NULL;
12170 PyObject *__pyx_t_7 = NULL;
12171 PyObject *__pyx_t_8 = NULL;
12172 PyObject *__pyx_t_9 = NULL;
12173 PyObject *__pyx_t_10 = NULL;
12174 PyObject *__pyx_t_11 = NULL;
12175 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
12184 __pyx_v_tmp = NULL;
12193 __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
12202 __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
12212 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12221 __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
12222 if (unlikely(__pyx_t_1)) {
12231 PyErr_NoMemory(); __PYX_ERR(1, 456, __pyx_L1_error)
12249 __pyx_v_item = __pyx_v_tmp;
12269 __pyx_v_item = ((
void *)__pyx_v_array);
12289 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12299 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12319 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 465, __pyx_L6_error)
12320 __Pyx_GOTREF(__pyx_t_2);
12321 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12332 __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12342 __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 470, __pyx_L6_error)
12343 __Pyx_GOTREF(__pyx_t_2);
12344 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12362 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12374 PyMem_Free(__pyx_v_tmp);
12379 __Pyx_PyThreadState_declare
12380 __Pyx_PyThreadState_assign
12381 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12382 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12383 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
12384 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
12385 __Pyx_XGOTREF(__pyx_t_6);
12386 __Pyx_XGOTREF(__pyx_t_7);
12387 __Pyx_XGOTREF(__pyx_t_8);
12388 __Pyx_XGOTREF(__pyx_t_9);
12389 __Pyx_XGOTREF(__pyx_t_10);
12390 __Pyx_XGOTREF(__pyx_t_11);
12391 __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
12393 PyMem_Free(__pyx_v_tmp);
12395 if (PY_MAJOR_VERSION >= 3) {
12396 __Pyx_XGIVEREF(__pyx_t_9);
12397 __Pyx_XGIVEREF(__pyx_t_10);
12398 __Pyx_XGIVEREF(__pyx_t_11);
12399 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
12401 __Pyx_XGIVEREF(__pyx_t_6);
12402 __Pyx_XGIVEREF(__pyx_t_7);
12403 __Pyx_XGIVEREF(__pyx_t_8);
12404 __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
12405 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12406 __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
12407 goto __pyx_L1_error;
12421 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12424 __Pyx_XDECREF(__pyx_t_2);
12425 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12428 __Pyx_XGIVEREF(__pyx_r);
12429 __Pyx_RefNannyFinishContext();
12441 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12442 char *__pyx_v_itemp;
12443 PyObject *__pyx_r = NULL;
12444 __Pyx_RefNannyDeclarations
12446 PyObject *__pyx_t_2 = NULL;
12447 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
12456 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 477, __pyx_L1_error)
12457 __pyx_v_itemp = __pyx_t_1;
12466 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 478, __pyx_L1_error)
12467 __Pyx_GOTREF(__pyx_t_2);
12468 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12479 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12482 __Pyx_XDECREF(__pyx_t_2);
12483 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12486 __Pyx_XGIVEREF(__pyx_r);
12487 __Pyx_RefNannyFinishContext();
12499 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
12500 PyObject *__pyx_v_struct = NULL;
12501 PyObject *__pyx_v_bytesitem = 0;
12502 PyObject *__pyx_v_result = NULL;
12503 PyObject *__pyx_r = NULL;
12504 __Pyx_RefNannyDeclarations
12505 PyObject *__pyx_t_1 = NULL;
12506 PyObject *__pyx_t_2 = NULL;
12507 PyObject *__pyx_t_3 = NULL;
12508 PyObject *__pyx_t_4 = NULL;
12509 PyObject *__pyx_t_5 = NULL;
12510 PyObject *__pyx_t_6 = NULL;
12511 PyObject *__pyx_t_7 = NULL;
12513 PyObject *__pyx_t_9 = NULL;
12516 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
12525 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error)
12526 __Pyx_GOTREF(__pyx_t_1);
12527 __pyx_v_struct = __pyx_t_1;
12537 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 486, __pyx_L1_error)
12538 __Pyx_GOTREF(__pyx_t_1);
12539 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12550 __Pyx_PyThreadState_declare
12551 __Pyx_PyThreadState_assign
12552 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12553 __Pyx_XGOTREF(__pyx_t_2);
12554 __Pyx_XGOTREF(__pyx_t_3);
12555 __Pyx_XGOTREF(__pyx_t_4);
12565 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 488, __pyx_L3_error)
12566 __Pyx_GOTREF(__pyx_t_5);
12567 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 488, __pyx_L3_error)
12568 __Pyx_GOTREF(__pyx_t_6);
12571 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12572 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12573 if (likely(__pyx_t_7)) {
12574 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12575 __Pyx_INCREF(__pyx_t_7);
12576 __Pyx_INCREF(
function);
12577 __Pyx_DECREF_SET(__pyx_t_5,
function);
12581 #if CYTHON_FAST_PYCALL
12582 if (PyFunction_Check(__pyx_t_5)) {
12583 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12584 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12585 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12586 __Pyx_GOTREF(__pyx_t_1);
12587 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12590 #if CYTHON_FAST_PYCCALL
12591 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12592 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12593 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12594 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12595 __Pyx_GOTREF(__pyx_t_1);
12596 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12600 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 488, __pyx_L3_error)
12601 __Pyx_GOTREF(__pyx_t_9);
12603 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12605 __Pyx_GIVEREF(__pyx_t_6);
12606 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12607 __Pyx_INCREF(__pyx_v_bytesitem);
12608 __Pyx_GIVEREF(__pyx_v_bytesitem);
12609 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12611 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12612 __Pyx_GOTREF(__pyx_t_1);
12613 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12615 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12616 __pyx_v_result = __pyx_t_1;
12636 __pyx_t_10 = strlen(__pyx_v_self->view.format);
12637 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12647 __Pyx_XDECREF(__pyx_r);
12648 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L5_except_error)
12649 __Pyx_GOTREF(__pyx_t_1);
12650 __pyx_r = __pyx_t_1;
12652 goto __pyx_L6_except_return;
12670 __Pyx_XDECREF(__pyx_r);
12671 __Pyx_INCREF(__pyx_v_result);
12672 __pyx_r = __pyx_v_result;
12673 goto __pyx_L6_except_return;
12676 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12677 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12678 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12679 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12680 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12689 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12690 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L5_except_error)
12691 __Pyx_GOTREF(__pyx_t_6);
12692 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12693 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12694 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12695 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12697 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12698 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 489, __pyx_L5_except_error)
12699 __Pyx_GOTREF(__pyx_t_9);
12700 __Pyx_GOTREF(__pyx_t_5);
12701 __Pyx_GOTREF(__pyx_t_1);
12710 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
12711 __Pyx_GOTREF(__pyx_t_6);
12712 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12713 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12714 __PYX_ERR(1, 490, __pyx_L5_except_error)
12716 goto __pyx_L5_except_error;
12717 __pyx_L5_except_error:;
12726 __Pyx_XGIVEREF(__pyx_t_2);
12727 __Pyx_XGIVEREF(__pyx_t_3);
12728 __Pyx_XGIVEREF(__pyx_t_4);
12729 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12730 goto __pyx_L1_error;
12731 __pyx_L6_except_return:;
12732 __Pyx_XGIVEREF(__pyx_t_2);
12733 __Pyx_XGIVEREF(__pyx_t_3);
12734 __Pyx_XGIVEREF(__pyx_t_4);
12735 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12749 __Pyx_XDECREF(__pyx_t_1);
12750 __Pyx_XDECREF(__pyx_t_5);
12751 __Pyx_XDECREF(__pyx_t_6);
12752 __Pyx_XDECREF(__pyx_t_7);
12753 __Pyx_XDECREF(__pyx_t_9);
12754 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12757 __Pyx_XDECREF(__pyx_v_struct);
12758 __Pyx_XDECREF(__pyx_v_bytesitem);
12759 __Pyx_XDECREF(__pyx_v_result);
12760 __Pyx_XGIVEREF(__pyx_r);
12761 __Pyx_RefNannyFinishContext();
12773 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12774 PyObject *__pyx_v_struct = NULL;
12776 PyObject *__pyx_v_bytesvalue = 0;
12777 Py_ssize_t __pyx_v_i;
12778 PyObject *__pyx_r = NULL;
12779 __Pyx_RefNannyDeclarations
12780 PyObject *__pyx_t_1 = NULL;
12783 PyObject *__pyx_t_4 = NULL;
12784 PyObject *__pyx_t_5 = NULL;
12785 PyObject *__pyx_t_6 = NULL;
12787 PyObject *__pyx_t_8 = NULL;
12788 Py_ssize_t __pyx_t_9;
12789 PyObject *__pyx_t_10 = NULL;
12794 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
12803 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error)
12804 __Pyx_GOTREF(__pyx_t_1);
12805 __pyx_v_struct = __pyx_t_1;
12815 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12816 __pyx_t_3 = (__pyx_t_2 != 0);
12826 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 505, __pyx_L1_error)
12827 __Pyx_GOTREF(__pyx_t_1);
12828 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12829 __Pyx_GOTREF(__pyx_t_4);
12830 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 505, __pyx_L1_error)
12831 __Pyx_GOTREF(__pyx_t_5);
12832 __Pyx_GIVEREF(__pyx_t_4);
12833 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12835 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12836 __Pyx_GOTREF(__pyx_t_4);
12837 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 505, __pyx_L1_error)
12838 __Pyx_GOTREF(__pyx_t_6);
12839 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12840 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12841 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12842 __Pyx_GOTREF(__pyx_t_4);
12843 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12844 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12845 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 505, __pyx_L1_error)
12846 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12867 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 507, __pyx_L1_error)
12868 __Pyx_GOTREF(__pyx_t_6);
12869 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 507, __pyx_L1_error)
12870 __Pyx_GOTREF(__pyx_t_1);
12873 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12874 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12875 if (likely(__pyx_t_5)) {
12876 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12877 __Pyx_INCREF(__pyx_t_5);
12878 __Pyx_INCREF(
function);
12879 __Pyx_DECREF_SET(__pyx_t_6,
function);
12883 #if CYTHON_FAST_PYCALL
12884 if (PyFunction_Check(__pyx_t_6)) {
12885 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12886 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12887 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12888 __Pyx_GOTREF(__pyx_t_4);
12889 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12892 #if CYTHON_FAST_PYCCALL
12893 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12894 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12895 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12896 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12897 __Pyx_GOTREF(__pyx_t_4);
12898 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12902 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 507, __pyx_L1_error)
12903 __Pyx_GOTREF(__pyx_t_8);
12905 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12907 __Pyx_GIVEREF(__pyx_t_1);
12908 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12909 __Pyx_INCREF(__pyx_v_value);
12910 __Pyx_GIVEREF(__pyx_v_value);
12911 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12913 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12914 __Pyx_GOTREF(__pyx_t_4);
12915 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12917 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12918 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 507, __pyx_L1_error)
12919 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12932 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12933 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
12934 __PYX_ERR(1, 509, __pyx_L1_error)
12936 __Pyx_INCREF(__pyx_v_bytesvalue);
12937 __pyx_t_10 = __pyx_v_bytesvalue;
12938 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12939 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12940 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12941 __pyx_t_11 = __pyx_t_14;
12942 __pyx_v_c = (__pyx_t_11[0]);
12951 __pyx_v_i = __pyx_t_9;
12960 __pyx_t_9 = (__pyx_t_9 + 1);
12969 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12971 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12982 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12985 __Pyx_XDECREF(__pyx_t_1);
12986 __Pyx_XDECREF(__pyx_t_4);
12987 __Pyx_XDECREF(__pyx_t_5);
12988 __Pyx_XDECREF(__pyx_t_6);
12989 __Pyx_XDECREF(__pyx_t_8);
12990 __Pyx_XDECREF(__pyx_t_10);
12991 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12994 __Pyx_XDECREF(__pyx_v_struct);
12995 __Pyx_XDECREF(__pyx_v_bytesvalue);
12996 __Pyx_XGIVEREF(__pyx_r);
12997 __Pyx_RefNannyFinishContext();
13010 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
13011 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13013 __Pyx_RefNannyDeclarations
13014 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
13015 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
13018 __Pyx_RefNannyFinishContext();
13022 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13024 __Pyx_RefNannyDeclarations
13027 PyObject *__pyx_t_3 = NULL;
13028 Py_ssize_t *__pyx_t_4;
13032 Py_ssize_t __pyx_t_8;
13033 if (__pyx_v_info == NULL) {
13034 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
13037 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
13038 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13039 __Pyx_GIVEREF(__pyx_v_info->obj);
13048 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13051 __pyx_t_1 = __pyx_t_2;
13052 goto __pyx_L4_bool_binop_done;
13054 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13055 __pyx_t_1 = __pyx_t_2;
13056 __pyx_L4_bool_binop_done:;
13057 if (unlikely(__pyx_t_1)) {
13066 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 515, __pyx_L1_error)
13067 __Pyx_GOTREF(__pyx_t_3);
13068 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13069 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13070 __PYX_ERR(1, 515, __pyx_L1_error)
13088 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13098 __pyx_t_4 = __pyx_v_self->view.shape;
13099 __pyx_v_info->shape = __pyx_t_4;
13119 __pyx_v_info->shape = NULL;
13130 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13140 __pyx_t_4 = __pyx_v_self->view.strides;
13141 __pyx_v_info->strides = __pyx_t_4;
13161 __pyx_v_info->strides = NULL;
13172 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13182 __pyx_t_4 = __pyx_v_self->view.suboffsets;
13183 __pyx_v_info->suboffsets = __pyx_t_4;
13203 __pyx_v_info->suboffsets = NULL;
13214 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13224 __pyx_t_5 = __pyx_v_self->view.format;
13225 __pyx_v_info->format = __pyx_t_5;
13245 __pyx_v_info->format = NULL;
13256 __pyx_t_6 = __pyx_v_self->view.buf;
13257 __pyx_v_info->buf = __pyx_t_6;
13266 __pyx_t_7 = __pyx_v_self->view.ndim;
13267 __pyx_v_info->ndim = __pyx_t_7;
13276 __pyx_t_8 = __pyx_v_self->view.itemsize;
13277 __pyx_v_info->itemsize = __pyx_t_8;
13286 __pyx_t_8 = __pyx_v_self->view.len;
13287 __pyx_v_info->len = __pyx_t_8;
13296 __pyx_t_1 = __pyx_v_self->view.readonly;
13297 __pyx_v_info->readonly = __pyx_t_1;
13306 __Pyx_INCREF(((PyObject *)__pyx_v_self));
13307 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13308 __Pyx_GOTREF(__pyx_v_info->obj);
13309 __Pyx_DECREF(__pyx_v_info->obj);
13310 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13324 __Pyx_XDECREF(__pyx_t_3);
13325 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13327 if (__pyx_v_info->obj != NULL) {
13328 __Pyx_GOTREF(__pyx_v_info->obj);
13329 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13333 if (__pyx_v_info->obj == Py_None) {
13334 __Pyx_GOTREF(__pyx_v_info->obj);
13335 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13338 __Pyx_RefNannyFinishContext();
13351 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
13352 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13353 PyObject *__pyx_r = 0;
13354 __Pyx_RefNannyDeclarations
13355 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13356 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13359 __Pyx_RefNannyFinishContext();
13363 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13364 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13365 PyObject *__pyx_r = NULL;
13366 __Pyx_RefNannyDeclarations
13367 PyObject *__pyx_t_1 = NULL;
13369 __Pyx_RefNannySetupContext(
"__get__", 0);
13378 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
13379 __Pyx_GOTREF(__pyx_t_1);
13380 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 549, __pyx_L1_error)
13381 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13391 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 550, __pyx_L1_error)
13400 __Pyx_XDECREF(__pyx_r);
13401 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13402 __pyx_r = ((PyObject *)__pyx_v_result);
13415 __Pyx_XDECREF(__pyx_t_1);
13416 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13419 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13420 __Pyx_XGIVEREF(__pyx_r);
13421 __Pyx_RefNannyFinishContext();
13434 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
13435 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13436 PyObject *__pyx_r = 0;
13437 __Pyx_RefNannyDeclarations
13438 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13439 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13442 __Pyx_RefNannyFinishContext();
13446 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13447 PyObject *__pyx_r = NULL;
13448 __Pyx_RefNannyDeclarations
13449 __Pyx_RefNannySetupContext(
"__get__", 0);
13458 __Pyx_XDECREF(__pyx_r);
13459 __Pyx_INCREF(__pyx_v_self->obj);
13460 __pyx_r = __pyx_v_self->obj;
13473 __Pyx_XGIVEREF(__pyx_r);
13474 __Pyx_RefNannyFinishContext();
13487 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
13488 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13489 PyObject *__pyx_r = 0;
13490 __Pyx_RefNannyDeclarations
13491 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13492 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13495 __Pyx_RefNannyFinishContext();
13499 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13500 Py_ssize_t __pyx_v_length;
13501 PyObject *__pyx_r = NULL;
13502 __Pyx_RefNannyDeclarations
13503 PyObject *__pyx_t_1 = NULL;
13504 Py_ssize_t *__pyx_t_2;
13505 Py_ssize_t *__pyx_t_3;
13506 Py_ssize_t *__pyx_t_4;
13507 PyObject *__pyx_t_5 = NULL;
13508 __Pyx_RefNannySetupContext(
"__get__", 0);
13517 __Pyx_XDECREF(__pyx_r);
13518 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
13519 __Pyx_GOTREF(__pyx_t_1);
13520 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13521 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13522 __pyx_t_2 = __pyx_t_4;
13523 __pyx_v_length = (__pyx_t_2[0]);
13524 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
13525 __Pyx_GOTREF(__pyx_t_5);
13526 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 559, __pyx_L1_error)
13527 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13529 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
13530 __Pyx_GOTREF(__pyx_t_5);
13531 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13532 __pyx_r = __pyx_t_5;
13546 __Pyx_XDECREF(__pyx_t_1);
13547 __Pyx_XDECREF(__pyx_t_5);
13548 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13551 __Pyx_XGIVEREF(__pyx_r);
13552 __Pyx_RefNannyFinishContext();
13565 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
13566 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13567 PyObject *__pyx_r = 0;
13568 __Pyx_RefNannyDeclarations
13569 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13570 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13573 __Pyx_RefNannyFinishContext();
13577 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13578 Py_ssize_t __pyx_v_stride;
13579 PyObject *__pyx_r = NULL;
13580 __Pyx_RefNannyDeclarations
13582 PyObject *__pyx_t_2 = NULL;
13583 Py_ssize_t *__pyx_t_3;
13584 Py_ssize_t *__pyx_t_4;
13585 Py_ssize_t *__pyx_t_5;
13586 PyObject *__pyx_t_6 = NULL;
13587 __Pyx_RefNannySetupContext(
"__get__", 0);
13596 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13597 if (unlikely(__pyx_t_1)) {
13606 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
13607 __Pyx_GOTREF(__pyx_t_2);
13608 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13609 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13610 __PYX_ERR(1, 565, __pyx_L1_error)
13628 __Pyx_XDECREF(__pyx_r);
13629 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 567, __pyx_L1_error)
13630 __Pyx_GOTREF(__pyx_t_2);
13631 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13632 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13633 __pyx_t_3 = __pyx_t_5;
13634 __pyx_v_stride = (__pyx_t_3[0]);
13635 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
13636 __Pyx_GOTREF(__pyx_t_6);
13637 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 567, __pyx_L1_error)
13638 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13640 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
13641 __Pyx_GOTREF(__pyx_t_6);
13642 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13643 __pyx_r = __pyx_t_6;
13657 __Pyx_XDECREF(__pyx_t_2);
13658 __Pyx_XDECREF(__pyx_t_6);
13659 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13662 __Pyx_XGIVEREF(__pyx_r);
13663 __Pyx_RefNannyFinishContext();
13676 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
13677 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13678 PyObject *__pyx_r = 0;
13679 __Pyx_RefNannyDeclarations
13680 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13681 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13684 __Pyx_RefNannyFinishContext();
13688 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13689 Py_ssize_t __pyx_v_suboffset;
13690 PyObject *__pyx_r = NULL;
13691 __Pyx_RefNannyDeclarations
13693 PyObject *__pyx_t_2 = NULL;
13694 PyObject *__pyx_t_3 = NULL;
13695 Py_ssize_t *__pyx_t_4;
13696 Py_ssize_t *__pyx_t_5;
13697 Py_ssize_t *__pyx_t_6;
13698 __Pyx_RefNannySetupContext(
"__get__", 0);
13707 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13717 __Pyx_XDECREF(__pyx_r);
13718 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13719 __Pyx_GOTREF(__pyx_t_2);
13720 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__27, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 572, __pyx_L1_error)
13721 __Pyx_GOTREF(__pyx_t_3);
13722 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13723 __pyx_r = __pyx_t_3;
13743 __Pyx_XDECREF(__pyx_r);
13744 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 574, __pyx_L1_error)
13745 __Pyx_GOTREF(__pyx_t_3);
13746 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13747 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13748 __pyx_t_4 = __pyx_t_6;
13749 __pyx_v_suboffset = (__pyx_t_4[0]);
13750 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
13751 __Pyx_GOTREF(__pyx_t_2);
13752 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 574, __pyx_L1_error)
13753 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13755 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
13756 __Pyx_GOTREF(__pyx_t_2);
13757 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13758 __pyx_r = __pyx_t_2;
13772 __Pyx_XDECREF(__pyx_t_2);
13773 __Pyx_XDECREF(__pyx_t_3);
13774 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13777 __Pyx_XGIVEREF(__pyx_r);
13778 __Pyx_RefNannyFinishContext();
13791 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
13792 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13793 PyObject *__pyx_r = 0;
13794 __Pyx_RefNannyDeclarations
13795 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13796 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13799 __Pyx_RefNannyFinishContext();
13803 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13804 PyObject *__pyx_r = NULL;
13805 __Pyx_RefNannyDeclarations
13806 PyObject *__pyx_t_1 = NULL;
13807 __Pyx_RefNannySetupContext(
"__get__", 0);
13816 __Pyx_XDECREF(__pyx_r);
13817 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 578, __pyx_L1_error)
13818 __Pyx_GOTREF(__pyx_t_1);
13819 __pyx_r = __pyx_t_1;
13833 __Pyx_XDECREF(__pyx_t_1);
13834 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13837 __Pyx_XGIVEREF(__pyx_r);
13838 __Pyx_RefNannyFinishContext();
13851 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
13852 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13853 PyObject *__pyx_r = 0;
13854 __Pyx_RefNannyDeclarations
13855 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13856 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13859 __Pyx_RefNannyFinishContext();
13863 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13864 PyObject *__pyx_r = NULL;
13865 __Pyx_RefNannyDeclarations
13866 PyObject *__pyx_t_1 = NULL;
13867 __Pyx_RefNannySetupContext(
"__get__", 0);
13876 __Pyx_XDECREF(__pyx_r);
13877 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error)
13878 __Pyx_GOTREF(__pyx_t_1);
13879 __pyx_r = __pyx_t_1;
13893 __Pyx_XDECREF(__pyx_t_1);
13894 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13897 __Pyx_XGIVEREF(__pyx_r);
13898 __Pyx_RefNannyFinishContext();
13911 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
13912 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13913 PyObject *__pyx_r = 0;
13914 __Pyx_RefNannyDeclarations
13915 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13916 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13919 __Pyx_RefNannyFinishContext();
13923 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13924 PyObject *__pyx_r = NULL;
13925 __Pyx_RefNannyDeclarations
13926 PyObject *__pyx_t_1 = NULL;
13927 PyObject *__pyx_t_2 = NULL;
13928 PyObject *__pyx_t_3 = NULL;
13929 __Pyx_RefNannySetupContext(
"__get__", 0);
13938 __Pyx_XDECREF(__pyx_r);
13939 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 586, __pyx_L1_error)
13940 __Pyx_GOTREF(__pyx_t_1);
13941 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 586, __pyx_L1_error)
13942 __Pyx_GOTREF(__pyx_t_2);
13943 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error)
13944 __Pyx_GOTREF(__pyx_t_3);
13945 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13946 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13947 __pyx_r = __pyx_t_3;
13961 __Pyx_XDECREF(__pyx_t_1);
13962 __Pyx_XDECREF(__pyx_t_2);
13963 __Pyx_XDECREF(__pyx_t_3);
13964 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13967 __Pyx_XGIVEREF(__pyx_r);
13968 __Pyx_RefNannyFinishContext();
13981 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
13982 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13983 PyObject *__pyx_r = 0;
13984 __Pyx_RefNannyDeclarations
13985 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13986 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13989 __Pyx_RefNannyFinishContext();
13993 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13994 PyObject *__pyx_v_result = NULL;
13995 PyObject *__pyx_v_length = NULL;
13996 PyObject *__pyx_r = NULL;
13997 __Pyx_RefNannyDeclarations
14000 Py_ssize_t *__pyx_t_3;
14001 Py_ssize_t *__pyx_t_4;
14002 Py_ssize_t *__pyx_t_5;
14003 PyObject *__pyx_t_6 = NULL;
14004 __Pyx_RefNannySetupContext(
"__get__", 0);
14013 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14014 __pyx_t_2 = (__pyx_t_1 != 0);
14024 __Pyx_INCREF(__pyx_int_1);
14025 __pyx_v_result = __pyx_int_1;
14034 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14035 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14036 __pyx_t_3 = __pyx_t_5;
14037 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 593, __pyx_L1_error)
14038 __Pyx_GOTREF(__pyx_t_6);
14039 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14049 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
14050 __Pyx_GOTREF(__pyx_t_6);
14051 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14062 __Pyx_INCREF(__pyx_v_result);
14063 __Pyx_GIVEREF(__pyx_v_result);
14064 __Pyx_GOTREF(__pyx_v_self->_size);
14065 __Pyx_DECREF(__pyx_v_self->_size);
14066 __pyx_v_self->_size = __pyx_v_result;
14084 __Pyx_XDECREF(__pyx_r);
14085 __Pyx_INCREF(__pyx_v_self->_size);
14086 __pyx_r = __pyx_v_self->_size;
14099 __Pyx_XDECREF(__pyx_t_6);
14100 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14103 __Pyx_XDECREF(__pyx_v_result);
14104 __Pyx_XDECREF(__pyx_v_length);
14105 __Pyx_XGIVEREF(__pyx_r);
14106 __Pyx_RefNannyFinishContext();
14119 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
14120 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14121 Py_ssize_t __pyx_r;
14122 __Pyx_RefNannyDeclarations
14123 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
14124 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14127 __Pyx_RefNannyFinishContext();
14131 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14132 Py_ssize_t __pyx_r;
14133 __Pyx_RefNannyDeclarations
14135 __Pyx_RefNannySetupContext(
"__len__", 0);
14144 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14154 __pyx_r = (__pyx_v_self->view.shape[0]);
14186 __Pyx_RefNannyFinishContext();
14199 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
14200 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14201 PyObject *__pyx_r = 0;
14202 __Pyx_RefNannyDeclarations
14203 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
14204 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14207 __Pyx_RefNannyFinishContext();
14211 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14212 PyObject *__pyx_r = NULL;
14213 __Pyx_RefNannyDeclarations
14214 PyObject *__pyx_t_1 = NULL;
14215 PyObject *__pyx_t_2 = NULL;
14216 PyObject *__pyx_t_3 = NULL;
14217 __Pyx_RefNannySetupContext(
"__repr__", 0);
14226 __Pyx_XDECREF(__pyx_r);
14227 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
14228 __Pyx_GOTREF(__pyx_t_1);
14229 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
14230 __Pyx_GOTREF(__pyx_t_2);
14231 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14232 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
14233 __Pyx_GOTREF(__pyx_t_1);
14234 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14243 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
14244 __Pyx_GOTREF(__pyx_t_2);
14253 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 607, __pyx_L1_error)
14254 __Pyx_GOTREF(__pyx_t_3);
14255 __Pyx_GIVEREF(__pyx_t_1);
14256 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14257 __Pyx_GIVEREF(__pyx_t_2);
14258 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14261 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
14262 __Pyx_GOTREF(__pyx_t_2);
14263 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14264 __pyx_r = __pyx_t_2;
14278 __Pyx_XDECREF(__pyx_t_1);
14279 __Pyx_XDECREF(__pyx_t_2);
14280 __Pyx_XDECREF(__pyx_t_3);
14281 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14284 __Pyx_XGIVEREF(__pyx_r);
14285 __Pyx_RefNannyFinishContext();
14298 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
14299 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14300 PyObject *__pyx_r = 0;
14301 __Pyx_RefNannyDeclarations
14302 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
14303 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14306 __Pyx_RefNannyFinishContext();
14310 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14311 PyObject *__pyx_r = NULL;
14312 __Pyx_RefNannyDeclarations
14313 PyObject *__pyx_t_1 = NULL;
14314 PyObject *__pyx_t_2 = NULL;
14315 __Pyx_RefNannySetupContext(
"__str__", 0);
14324 __Pyx_XDECREF(__pyx_r);
14325 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14326 __Pyx_GOTREF(__pyx_t_1);
14327 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
14328 __Pyx_GOTREF(__pyx_t_2);
14329 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14330 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14331 __Pyx_GOTREF(__pyx_t_1);
14332 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14333 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
14334 __Pyx_GOTREF(__pyx_t_2);
14335 __Pyx_GIVEREF(__pyx_t_1);
14336 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14338 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14339 __Pyx_GOTREF(__pyx_t_1);
14340 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14341 __pyx_r = __pyx_t_1;
14355 __Pyx_XDECREF(__pyx_t_1);
14356 __Pyx_XDECREF(__pyx_t_2);
14357 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14360 __Pyx_XGIVEREF(__pyx_r);
14361 __Pyx_RefNannyFinishContext();
14374 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14375 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14376 PyObject *__pyx_r = 0;
14377 __Pyx_RefNannyDeclarations
14378 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
14379 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14382 __Pyx_RefNannyFinishContext();
14386 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14387 __Pyx_memviewslice *__pyx_v_mslice;
14388 __Pyx_memviewslice __pyx_v_tmp;
14389 PyObject *__pyx_r = NULL;
14390 __Pyx_RefNannyDeclarations
14391 PyObject *__pyx_t_1 = NULL;
14392 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
14401 __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
14410 __Pyx_XDECREF(__pyx_r);
14411 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
14412 __Pyx_GOTREF(__pyx_t_1);
14413 __pyx_r = __pyx_t_1;
14427 __Pyx_XDECREF(__pyx_t_1);
14428 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14431 __Pyx_XGIVEREF(__pyx_r);
14432 __Pyx_RefNannyFinishContext();
14445 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14446 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14447 PyObject *__pyx_r = 0;
14448 __Pyx_RefNannyDeclarations
14449 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
14450 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14453 __Pyx_RefNannyFinishContext();
14457 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14458 __Pyx_memviewslice *__pyx_v_mslice;
14459 __Pyx_memviewslice __pyx_v_tmp;
14460 PyObject *__pyx_r = NULL;
14461 __Pyx_RefNannyDeclarations
14462 PyObject *__pyx_t_1 = NULL;
14463 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
14472 __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
14481 __Pyx_XDECREF(__pyx_r);
14482 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 624, __pyx_L1_error)
14483 __Pyx_GOTREF(__pyx_t_1);
14484 __pyx_r = __pyx_t_1;
14498 __Pyx_XDECREF(__pyx_t_1);
14499 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14502 __Pyx_XGIVEREF(__pyx_r);
14503 __Pyx_RefNannyFinishContext();
14516 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14517 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14518 PyObject *__pyx_r = 0;
14519 __Pyx_RefNannyDeclarations
14520 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
14521 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14524 __Pyx_RefNannyFinishContext();
14528 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
14529 __Pyx_memviewslice __pyx_v_mslice;
14531 PyObject *__pyx_r = NULL;
14532 __Pyx_RefNannyDeclarations
14533 __Pyx_memviewslice __pyx_t_1;
14534 PyObject *__pyx_t_2 = NULL;
14535 __Pyx_RefNannySetupContext(
"copy", 0);
14544 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14553 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14562 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 631, __pyx_L1_error)
14563 __pyx_v_mslice = __pyx_t_1;
14572 __Pyx_XDECREF(__pyx_r);
14573 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 636, __pyx_L1_error)
14574 __Pyx_GOTREF(__pyx_t_2);
14575 __pyx_r = __pyx_t_2;
14589 __Pyx_XDECREF(__pyx_t_2);
14590 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14593 __Pyx_XGIVEREF(__pyx_r);
14594 __Pyx_RefNannyFinishContext();
14607 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14608 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14609 PyObject *__pyx_r = 0;
14610 __Pyx_RefNannyDeclarations
14611 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
14612 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14615 __Pyx_RefNannyFinishContext();
14619 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
14620 __Pyx_memviewslice __pyx_v_src;
14621 __Pyx_memviewslice __pyx_v_dst;
14623 PyObject *__pyx_r = NULL;
14624 __Pyx_RefNannyDeclarations
14625 __Pyx_memviewslice __pyx_t_1;
14626 PyObject *__pyx_t_2 = NULL;
14627 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
14636 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14645 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14654 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 643, __pyx_L1_error)
14655 __pyx_v_dst = __pyx_t_1;
14664 __Pyx_XDECREF(__pyx_r);
14665 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 648, __pyx_L1_error)
14666 __Pyx_GOTREF(__pyx_t_2);
14667 __pyx_r = __pyx_t_2;
14681 __Pyx_XDECREF(__pyx_t_2);
14682 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14685 __Pyx_XGIVEREF(__pyx_r);
14686 __Pyx_RefNannyFinishContext();
14697 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14698 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14699 PyObject *__pyx_r = 0;
14700 __Pyx_RefNannyDeclarations
14701 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
14702 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14705 __Pyx_RefNannyFinishContext();
14709 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
14710 PyObject *__pyx_r = NULL;
14711 __Pyx_RefNannyDeclarations
14712 PyObject *__pyx_t_1 = NULL;
14713 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
14721 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14722 __Pyx_GOTREF(__pyx_t_1);
14723 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14724 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14725 __PYX_ERR(1, 2, __pyx_L1_error)
14735 __Pyx_XDECREF(__pyx_t_1);
14736 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14738 __Pyx_XGIVEREF(__pyx_r);
14739 __Pyx_RefNannyFinishContext();
14751 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
14752 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14753 PyObject *__pyx_r = 0;
14754 __Pyx_RefNannyDeclarations
14755 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
14756 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14759 __Pyx_RefNannyFinishContext();
14763 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14764 PyObject *__pyx_r = NULL;
14765 __Pyx_RefNannyDeclarations
14766 PyObject *__pyx_t_1 = NULL;
14767 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
14774 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14775 __Pyx_GOTREF(__pyx_t_1);
14776 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14778 __PYX_ERR(1, 4, __pyx_L1_error)
14789 __Pyx_XDECREF(__pyx_t_1);
14790 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14792 __Pyx_XGIVEREF(__pyx_r);
14793 __Pyx_RefNannyFinishContext();
14805 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14806 struct __pyx_memoryview_obj *__pyx_v_result = 0;
14807 PyObject *__pyx_r = NULL;
14808 __Pyx_RefNannyDeclarations
14809 PyObject *__pyx_t_1 = NULL;
14810 PyObject *__pyx_t_2 = NULL;
14811 PyObject *__pyx_t_3 = NULL;
14812 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
14821 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 653, __pyx_L1_error)
14822 __Pyx_GOTREF(__pyx_t_1);
14823 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14824 __Pyx_GOTREF(__pyx_t_2);
14825 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 653, __pyx_L1_error)
14826 __Pyx_GOTREF(__pyx_t_3);
14827 __Pyx_INCREF(__pyx_v_o);
14828 __Pyx_GIVEREF(__pyx_v_o);
14829 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14830 __Pyx_GIVEREF(__pyx_t_1);
14831 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14832 __Pyx_GIVEREF(__pyx_t_2);
14833 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14836 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14837 __Pyx_GOTREF(__pyx_t_2);
14838 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14839 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14849 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14858 __Pyx_XDECREF(__pyx_r);
14859 __Pyx_INCREF(((PyObject *)__pyx_v_result));
14860 __pyx_r = ((PyObject *)__pyx_v_result);
14873 __Pyx_XDECREF(__pyx_t_1);
14874 __Pyx_XDECREF(__pyx_t_2);
14875 __Pyx_XDECREF(__pyx_t_3);
14876 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14879 __Pyx_XDECREF((PyObject *)__pyx_v_result);
14880 __Pyx_XGIVEREF(__pyx_r);
14881 __Pyx_RefNannyFinishContext();
14893 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14895 __Pyx_RefNannyDeclarations
14897 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
14906 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14907 __pyx_r = __pyx_t_1;
14920 __Pyx_RefNannyFinishContext();
14932 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
14933 PyObject *__pyx_v_tup = NULL;
14934 PyObject *__pyx_v_result = NULL;
14935 int __pyx_v_have_slices;
14936 int __pyx_v_seen_ellipsis;
14937 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14938 PyObject *__pyx_v_item = NULL;
14939 Py_ssize_t __pyx_v_nslices;
14940 PyObject *__pyx_r = NULL;
14941 __Pyx_RefNannyDeclarations
14944 PyObject *__pyx_t_3 = NULL;
14945 PyObject *__pyx_t_4 = NULL;
14946 Py_ssize_t __pyx_t_5;
14947 PyObject *(*__pyx_t_6)(PyObject *);
14948 PyObject *__pyx_t_7 = NULL;
14949 Py_ssize_t __pyx_t_8;
14952 PyObject *__pyx_t_11 = NULL;
14953 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
14962 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14963 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14973 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
14974 __Pyx_GOTREF(__pyx_t_3);
14975 __Pyx_INCREF(__pyx_v_index);
14976 __Pyx_GIVEREF(__pyx_v_index);
14977 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14978 __pyx_v_tup = __pyx_t_3;
14999 __Pyx_INCREF(__pyx_v_index);
15000 __pyx_v_tup = __pyx_v_index;
15011 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 671, __pyx_L1_error)
15012 __Pyx_GOTREF(__pyx_t_3);
15013 __pyx_v_result = ((PyObject*)__pyx_t_3);
15023 __pyx_v_have_slices = 0;
15032 __pyx_v_seen_ellipsis = 0;
15041 __Pyx_INCREF(__pyx_int_0);
15042 __pyx_t_3 = __pyx_int_0;
15043 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15044 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15047 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 674, __pyx_L1_error)
15048 __Pyx_GOTREF(__pyx_t_4);
15049 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 674, __pyx_L1_error)
15052 if (likely(!__pyx_t_6)) {
15053 if (likely(PyList_CheckExact(__pyx_t_4))) {
15054 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
15055 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15056 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
15058 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15059 __Pyx_GOTREF(__pyx_t_7);
15062 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
15063 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15064 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
15066 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15067 __Pyx_GOTREF(__pyx_t_7);
15071 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15072 if (unlikely(!__pyx_t_7)) {
15073 PyObject* exc_type = PyErr_Occurred();
15075 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15076 else __PYX_ERR(1, 674, __pyx_L1_error)
15080 __Pyx_GOTREF(__pyx_t_7);
15082 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15084 __Pyx_INCREF(__pyx_t_3);
15085 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15086 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15087 __Pyx_GOTREF(__pyx_t_7);
15088 __Pyx_DECREF(__pyx_t_3);
15089 __pyx_t_3 = __pyx_t_7;
15099 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15100 __pyx_t_1 = (__pyx_t_2 != 0);
15110 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15120 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
15121 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 677, __pyx_L1_error)
15122 __Pyx_GOTREF(__pyx_t_7);
15123 { Py_ssize_t __pyx_temp;
15124 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15125 __Pyx_INCREF(__pyx_slice__30);
15126 __Pyx_GIVEREF(__pyx_slice__30);
15127 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__30);
15130 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
15131 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15140 __pyx_v_seen_ellipsis = 1;
15160 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__31);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 680, __pyx_L1_error)
15171 __pyx_v_have_slices = 1;
15191 __pyx_t_2 = PySlice_Check(__pyx_v_item);
15192 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15195 __pyx_t_1 = __pyx_t_10;
15196 goto __pyx_L9_bool_binop_done;
15198 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15199 __pyx_t_1 = __pyx_t_10;
15200 __pyx_L9_bool_binop_done:;
15201 if (unlikely(__pyx_t_1)) {
15210 __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
15211 __Pyx_GOTREF(__pyx_t_7);
15212 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 684, __pyx_L1_error)
15213 __Pyx_GOTREF(__pyx_t_11);
15214 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15215 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15216 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15217 __PYX_ERR(1, 684, __pyx_L1_error)
15235 __pyx_t_10 = (__pyx_v_have_slices != 0);
15238 __pyx_t_1 = __pyx_t_10;
15239 goto __pyx_L11_bool_binop_done;
15241 __pyx_t_10 = PySlice_Check(__pyx_v_item);
15242 __pyx_t_2 = (__pyx_t_10 != 0);
15243 __pyx_t_1 = __pyx_t_2;
15244 __pyx_L11_bool_binop_done:;
15245 __pyx_v_have_slices = __pyx_t_1;
15254 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
15266 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15267 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15276 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 689, __pyx_L1_error)
15277 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15286 __pyx_t_1 = (__pyx_v_nslices != 0);
15296 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 691, __pyx_L1_error)
15297 __Pyx_GOTREF(__pyx_t_3);
15298 { Py_ssize_t __pyx_temp;
15299 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15300 __Pyx_INCREF(__pyx_slice__32);
15301 __Pyx_GIVEREF(__pyx_slice__32);
15302 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32);
15305 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 691, __pyx_L1_error)
15306 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15324 __Pyx_XDECREF(__pyx_r);
15325 if (!__pyx_v_have_slices) {
15327 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15328 __Pyx_GOTREF(__pyx_t_4);
15329 __pyx_t_3 = __pyx_t_4;
15331 goto __pyx_L14_bool_binop_done;
15333 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15334 __Pyx_GOTREF(__pyx_t_4);
15335 __pyx_t_3 = __pyx_t_4;
15337 __pyx_L14_bool_binop_done:;
15338 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15339 __Pyx_GOTREF(__pyx_t_4);
15340 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 693, __pyx_L1_error)
15341 __Pyx_GOTREF(__pyx_t_11);
15342 __Pyx_GIVEREF(__pyx_t_3);
15343 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15344 __Pyx_GIVEREF(__pyx_t_4);
15345 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15348 __pyx_r = ((PyObject*)__pyx_t_11);
15362 __Pyx_XDECREF(__pyx_t_3);
15363 __Pyx_XDECREF(__pyx_t_4);
15364 __Pyx_XDECREF(__pyx_t_7);
15365 __Pyx_XDECREF(__pyx_t_11);
15366 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15369 __Pyx_XDECREF(__pyx_v_tup);
15370 __Pyx_XDECREF(__pyx_v_result);
15371 __Pyx_XDECREF(__pyx_v_idx);
15372 __Pyx_XDECREF(__pyx_v_item);
15373 __Pyx_XGIVEREF(__pyx_r);
15374 __Pyx_RefNannyFinishContext();
15386 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
15387 Py_ssize_t __pyx_v_suboffset;
15388 PyObject *__pyx_r = NULL;
15389 __Pyx_RefNannyDeclarations
15390 Py_ssize_t *__pyx_t_1;
15391 Py_ssize_t *__pyx_t_2;
15392 Py_ssize_t *__pyx_t_3;
15394 PyObject *__pyx_t_5 = NULL;
15395 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
15404 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15405 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15406 __pyx_t_1 = __pyx_t_3;
15407 __pyx_v_suboffset = (__pyx_t_1[0]);
15416 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15417 if (unlikely(__pyx_t_4)) {
15426 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 698, __pyx_L1_error)
15427 __Pyx_GOTREF(__pyx_t_5);
15428 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15429 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15430 __PYX_ERR(1, 698, __pyx_L1_error)
15451 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15454 __Pyx_XDECREF(__pyx_t_5);
15455 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15458 __Pyx_XGIVEREF(__pyx_r);
15459 __Pyx_RefNannyFinishContext();
15471 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15472 int __pyx_v_new_ndim;
15473 int __pyx_v_suboffset_dim;
15475 __Pyx_memviewslice __pyx_v_src;
15476 __Pyx_memviewslice __pyx_v_dst;
15477 __Pyx_memviewslice *__pyx_v_p_src;
15478 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15479 __Pyx_memviewslice *__pyx_v_p_dst;
15480 int *__pyx_v_p_suboffset_dim;
15481 Py_ssize_t __pyx_v_start;
15482 Py_ssize_t __pyx_v_stop;
15483 Py_ssize_t __pyx_v_step;
15484 int __pyx_v_have_start;
15485 int __pyx_v_have_stop;
15486 int __pyx_v_have_step;
15487 PyObject *__pyx_v_index = NULL;
15488 struct __pyx_memoryview_obj *__pyx_r = NULL;
15489 __Pyx_RefNannyDeclarations
15492 PyObject *__pyx_t_3 = NULL;
15493 struct __pyx_memoryview_obj *__pyx_t_4;
15496 Py_ssize_t __pyx_t_7;
15497 PyObject *(*__pyx_t_8)(PyObject *);
15498 PyObject *__pyx_t_9 = NULL;
15499 Py_ssize_t __pyx_t_10;
15501 Py_ssize_t __pyx_t_12;
15502 __Pyx_RefNannySetupContext(
"memview_slice", 0);
15511 __pyx_v_new_ndim = 0;
15512 __pyx_v_suboffset_dim = -1;
15521 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
15530 #ifndef CYTHON_WITHOUT_ASSERTIONS
15531 if (unlikely(!Py_OptimizeFlag)) {
15532 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15533 PyErr_SetNone(PyExc_AssertionError);
15534 __PYX_ERR(1, 717, __pyx_L1_error)
15546 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15547 __pyx_t_2 = (__pyx_t_1 != 0);
15557 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 720, __pyx_L1_error)
15558 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15559 __Pyx_INCREF(__pyx_t_3);
15560 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15570 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15590 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15599 __pyx_v_p_src = (&__pyx_v_src);
15610 __pyx_t_4 = __pyx_v_p_src->memview;
15611 __pyx_v_dst.memview = __pyx_t_4;
15620 __pyx_t_5 = __pyx_v_p_src->data;
15621 __pyx_v_dst.data = __pyx_t_5;
15630 __pyx_v_p_dst = (&__pyx_v_dst);
15639 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15649 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15650 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15653 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 741, __pyx_L1_error)
15654 __Pyx_GOTREF(__pyx_t_3);
15655 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 741, __pyx_L1_error)
15658 if (likely(!__pyx_t_8)) {
15659 if (likely(PyList_CheckExact(__pyx_t_3))) {
15660 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
15661 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15662 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
15664 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
15665 __Pyx_GOTREF(__pyx_t_9);
15668 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
15669 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15670 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
15672 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
15673 __Pyx_GOTREF(__pyx_t_9);
15677 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15678 if (unlikely(!__pyx_t_9)) {
15679 PyObject* exc_type = PyErr_Occurred();
15681 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15682 else __PYX_ERR(1, 741, __pyx_L1_error)
15686 __Pyx_GOTREF(__pyx_t_9);
15688 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15690 __pyx_v_dim = __pyx_t_6;
15691 __pyx_t_6 = (__pyx_t_6 + 1);
15700 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15710 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
15719 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 743, __pyx_L1_error)
15738 __pyx_t_2 = (__pyx_v_index == Py_None);
15739 __pyx_t_1 = (__pyx_t_2 != 0);
15749 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15758 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15767 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
15776 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15796 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 755, __pyx_L1_error)
15797 __Pyx_GOTREF(__pyx_t_9);
15798 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 755, __pyx_L1_error)
15800 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15802 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 755, __pyx_L1_error)
15803 __pyx_t_10 = __pyx_t_12;
15804 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15805 goto __pyx_L7_bool_binop_done;
15808 __pyx_L7_bool_binop_done:;
15809 __pyx_v_start = __pyx_t_10;
15818 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
15819 __Pyx_GOTREF(__pyx_t_9);
15820 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
15822 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15824 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
15825 __pyx_t_10 = __pyx_t_12;
15826 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15827 goto __pyx_L9_bool_binop_done;
15830 __pyx_L9_bool_binop_done:;
15831 __pyx_v_stop = __pyx_t_10;
15840 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
15841 __Pyx_GOTREF(__pyx_t_9);
15842 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
15844 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15846 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
15847 __pyx_t_10 = __pyx_t_12;
15848 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15849 goto __pyx_L11_bool_binop_done;
15852 __pyx_L11_bool_binop_done:;
15853 __pyx_v_step = __pyx_t_10;
15862 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 759, __pyx_L1_error)
15863 __Pyx_GOTREF(__pyx_t_9);
15864 __pyx_t_1 = (__pyx_t_9 != Py_None);
15865 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15866 __pyx_v_have_start = __pyx_t_1;
15875 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15876 __Pyx_GOTREF(__pyx_t_9);
15877 __pyx_t_1 = (__pyx_t_9 != Py_None);
15878 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15879 __pyx_v_have_stop = __pyx_t_1;
15888 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15889 __Pyx_GOTREF(__pyx_t_9);
15890 __pyx_t_1 = (__pyx_t_9 != Py_None);
15891 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15892 __pyx_v_have_step = __pyx_t_1;
15901 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 763, __pyx_L1_error)
15910 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15922 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15931 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15932 __pyx_t_2 = (__pyx_t_1 != 0);
15942 __Pyx_XDECREF(((PyObject *)__pyx_r));
15951 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 773, __pyx_L1_error) }
15960 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
15969 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 772, __pyx_L1_error)
15970 __Pyx_GOTREF(__pyx_t_3);
15971 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 772, __pyx_L1_error)
15972 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15993 __Pyx_XDECREF(((PyObject *)__pyx_r));
16002 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
16003 __Pyx_GOTREF(__pyx_t_3);
16012 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
16013 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16028 __Pyx_XDECREF(__pyx_t_3);
16029 __Pyx_XDECREF(__pyx_t_9);
16030 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16033 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16034 __Pyx_XDECREF(__pyx_v_index);
16035 __Pyx_XGIVEREF((PyObject *)__pyx_r);
16036 __Pyx_RefNannyFinishContext();
16048 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
16049 Py_ssize_t __pyx_v_new_shape;
16050 int __pyx_v_negative_step;
16063 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16073 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16083 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16101 __pyx_t_1 = (0 <= __pyx_v_start);
16103 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16105 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16115 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 827, __pyx_L1_error)
16144 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16147 __pyx_t_2 = __pyx_t_1;
16148 goto __pyx_L6_bool_binop_done;
16150 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16151 __pyx_t_2 = __pyx_t_1;
16152 __pyx_L6_bool_binop_done:;
16153 __pyx_v_negative_step = __pyx_t_2;
16162 __pyx_t_1 = (__pyx_v_have_step != 0);
16165 __pyx_t_2 = __pyx_t_1;
16166 goto __pyx_L9_bool_binop_done;
16168 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16169 __pyx_t_2 = __pyx_t_1;
16170 __pyx_L9_bool_binop_done:;
16180 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 833, __pyx_L1_error)
16198 __pyx_t_2 = (__pyx_v_have_start != 0);
16208 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16218 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16227 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16265 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16275 __pyx_t_2 = (__pyx_v_negative_step != 0);
16285 __pyx_v_start = (__pyx_v_shape - 1);
16305 __pyx_v_start = __pyx_v_shape;
16337 __pyx_t_2 = (__pyx_v_negative_step != 0);
16347 __pyx_v_start = (__pyx_v_shape - 1);
16380 __pyx_t_2 = (__pyx_v_have_stop != 0);
16390 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16400 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16409 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16447 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16457 __pyx_v_stop = __pyx_v_shape;
16487 __pyx_t_2 = (__pyx_v_negative_step != 0);
16497 __pyx_v_stop = -1
L;
16517 __pyx_v_stop = __pyx_v_shape;
16530 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16558 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16567 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16577 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16595 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16605 __pyx_v_new_shape = 0;
16623 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16632 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16641 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16652 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16662 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16682 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16683 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16694 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16704 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16714 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16724 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16752 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 894, __pyx_L1_error)
16774 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16809 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16811 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16813 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16829 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16830 Py_ssize_t __pyx_v_shape;
16831 Py_ssize_t __pyx_v_stride;
16832 Py_ssize_t __pyx_v_suboffset;
16833 Py_ssize_t __pyx_v_itemsize;
16834 char *__pyx_v_resultp;
16836 __Pyx_RefNannyDeclarations
16837 Py_ssize_t __pyx_t_1;
16839 PyObject *__pyx_t_3 = NULL;
16840 PyObject *__pyx_t_4 = NULL;
16841 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
16850 __pyx_v_suboffset = -1
L;
16859 __pyx_t_1 = __pyx_v_view->itemsize;
16860 __pyx_v_itemsize = __pyx_t_1;
16869 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16879 if (unlikely(__pyx_v_itemsize == 0)) {
16880 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
16881 __PYX_ERR(1, 912, __pyx_L1_error)
16883 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16884 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
16885 __PYX_ERR(1, 912, __pyx_L1_error)
16887 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16896 __pyx_v_stride = __pyx_v_itemsize;
16916 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16925 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16934 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16944 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16964 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16974 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16983 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16984 if (unlikely(__pyx_t_2)) {
16993 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
16994 __Pyx_GOTREF(__pyx_t_3);
16995 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 923, __pyx_L1_error)
16996 __Pyx_GOTREF(__pyx_t_4);
16997 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16998 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
16999 __Pyx_GOTREF(__pyx_t_3);
17000 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17001 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17002 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17003 __PYX_ERR(1, 923, __pyx_L1_error)
17030 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17031 if (unlikely(__pyx_t_2)) {
17040 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
17041 __Pyx_GOTREF(__pyx_t_3);
17042 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 926, __pyx_L1_error)
17043 __Pyx_GOTREF(__pyx_t_4);
17044 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17045 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
17046 __Pyx_GOTREF(__pyx_t_3);
17047 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17048 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17049 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17050 __PYX_ERR(1, 926, __pyx_L1_error)
17068 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17077 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17087 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17105 __pyx_r = __pyx_v_resultp;
17118 __Pyx_XDECREF(__pyx_t_3);
17119 __Pyx_XDECREF(__pyx_t_4);
17120 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17123 __Pyx_RefNannyFinishContext();
17135 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17137 Py_ssize_t *__pyx_v_shape;
17138 Py_ssize_t *__pyx_v_strides;
17143 Py_ssize_t *__pyx_t_2;
17146 Py_ssize_t __pyx_t_5;
17147 Py_ssize_t __pyx_t_6;
17159 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17160 __pyx_v_ndim = __pyx_t_1;
17169 __pyx_t_2 = __pyx_v_memslice->shape;
17170 __pyx_v_shape = __pyx_t_2;
17179 __pyx_t_2 = __pyx_v_memslice->strides;
17180 __pyx_v_strides = __pyx_t_2;
17189 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17190 __pyx_t_4 = __pyx_t_3;
17191 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17192 __pyx_v_i = __pyx_t_1;
17201 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17210 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17211 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17212 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17213 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17222 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17223 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17224 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17225 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17234 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17237 __pyx_t_7 = __pyx_t_8;
17238 goto __pyx_L6_bool_binop_done;
17240 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17241 __pyx_t_7 = __pyx_t_8;
17242 __pyx_L6_bool_binop_done:;
17252 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 952, __pyx_L1_error)
17286 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17288 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17290 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17307 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
17308 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17309 __Pyx_RefNannyDeclarations
17310 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
17311 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17314 __Pyx_RefNannyFinishContext();
17317 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17318 __Pyx_RefNannyDeclarations
17319 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
17328 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17339 __Pyx_RefNannyFinishContext();
17350 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
17351 PyObject *__pyx_r = NULL;
17352 __Pyx_RefNannyDeclarations
17354 PyObject *__pyx_t_2 = NULL;
17355 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
17364 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17374 __Pyx_XDECREF(__pyx_r);
17375 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 976, __pyx_L1_error)
17376 __Pyx_GOTREF(__pyx_t_2);
17377 __pyx_r = __pyx_t_2;
17398 __Pyx_XDECREF(__pyx_r);
17399 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 978, __pyx_L1_error)
17400 __Pyx_GOTREF(__pyx_t_2);
17401 __pyx_r = __pyx_t_2;
17416 __Pyx_XDECREF(__pyx_t_2);
17417 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17420 __Pyx_XGIVEREF(__pyx_r);
17421 __Pyx_RefNannyFinishContext();
17433 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17434 PyObject *__pyx_r = NULL;
17435 __Pyx_RefNannyDeclarations
17438 PyObject *__pyx_t_3 = NULL;
17439 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
17448 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17458 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 982, __pyx_L1_error)
17478 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 984, __pyx_L1_error)
17479 __Pyx_GOTREF(__pyx_t_3);
17480 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17493 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17496 __Pyx_XDECREF(__pyx_t_3);
17497 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17500 __Pyx_XGIVEREF(__pyx_r);
17501 __Pyx_RefNannyFinishContext();
17514 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
17515 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17516 PyObject *__pyx_r = 0;
17517 __Pyx_RefNannyDeclarations
17518 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17519 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17522 __Pyx_RefNannyFinishContext();
17526 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17527 PyObject *__pyx_r = NULL;
17528 __Pyx_RefNannyDeclarations
17529 __Pyx_RefNannySetupContext(
"__get__", 0);
17538 __Pyx_XDECREF(__pyx_r);
17539 __Pyx_INCREF(__pyx_v_self->from_object);
17540 __pyx_r = __pyx_v_self->from_object;
17553 __Pyx_XGIVEREF(__pyx_r);
17554 __Pyx_RefNannyFinishContext();
17565 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17566 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17567 PyObject *__pyx_r = 0;
17568 __Pyx_RefNannyDeclarations
17569 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
17570 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17573 __Pyx_RefNannyFinishContext();
17577 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17578 PyObject *__pyx_r = NULL;
17579 __Pyx_RefNannyDeclarations
17580 PyObject *__pyx_t_1 = NULL;
17581 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
17589 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17590 __Pyx_GOTREF(__pyx_t_1);
17591 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17592 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17593 __PYX_ERR(1, 2, __pyx_L1_error)
17603 __Pyx_XDECREF(__pyx_t_1);
17604 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17606 __Pyx_XGIVEREF(__pyx_r);
17607 __Pyx_RefNannyFinishContext();
17619 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
17620 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17621 PyObject *__pyx_r = 0;
17622 __Pyx_RefNannyDeclarations
17623 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
17624 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17627 __Pyx_RefNannyFinishContext();
17631 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17632 PyObject *__pyx_r = NULL;
17633 __Pyx_RefNannyDeclarations
17634 PyObject *__pyx_t_1 = NULL;
17635 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
17642 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17643 __Pyx_GOTREF(__pyx_t_1);
17644 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17645 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17646 __PYX_ERR(1, 4, __pyx_L1_error)
17657 __Pyx_XDECREF(__pyx_t_1);
17658 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17660 __Pyx_XGIVEREF(__pyx_r);
17661 __Pyx_RefNannyFinishContext();
17673 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
17674 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17675 Py_ssize_t __pyx_v_suboffset;
17676 PyObject *__pyx_v_length = NULL;
17677 PyObject *__pyx_r = NULL;
17678 __Pyx_RefNannyDeclarations
17680 PyObject *__pyx_t_2 = NULL;
17681 PyObject *__pyx_t_3 = NULL;
17682 __Pyx_TypeInfo *__pyx_t_4;
17683 Py_buffer __pyx_t_5;
17684 Py_ssize_t *__pyx_t_6;
17685 Py_ssize_t *__pyx_t_7;
17686 Py_ssize_t *__pyx_t_8;
17687 Py_ssize_t __pyx_t_9;
17688 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
17697 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17707 __Pyx_XDECREF(__pyx_r);
17708 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17727 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
17728 __Pyx_GOTREF(__pyx_t_2);
17729 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1008, __pyx_L1_error)
17730 __Pyx_GOTREF(__pyx_t_3);
17731 __Pyx_INCREF(Py_None);
17732 __Pyx_GIVEREF(Py_None);
17733 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17734 __Pyx_INCREF(__pyx_int_0);
17735 __Pyx_GIVEREF(__pyx_int_0);
17736 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17737 __Pyx_GIVEREF(__pyx_t_2);
17738 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17740 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
17741 __Pyx_GOTREF(__pyx_t_2);
17742 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17743 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17753 __pyx_v_result->from_slice = __pyx_v_memviewslice;
17762 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17771 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17772 __Pyx_GOTREF(__pyx_t_2);
17773 __Pyx_GIVEREF(__pyx_t_2);
17774 __Pyx_GOTREF(__pyx_v_result->from_object);
17775 __Pyx_DECREF(__pyx_v_result->from_object);
17776 __pyx_v_result->from_object = __pyx_t_2;
17786 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17787 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17796 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17797 __pyx_v_result->__pyx_base.view = __pyx_t_5;
17806 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
17815 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17824 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17833 Py_INCREF(Py_None);
17842 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17852 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17872 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17883 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17892 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17901 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17910 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17911 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17912 __pyx_t_6 = __pyx_t_8;
17913 __pyx_v_suboffset = (__pyx_t_6[0]);
17922 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17932 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17941 goto __pyx_L6_break;
17961 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17962 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17971 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17972 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17973 __pyx_t_6 = __pyx_t_8;
17974 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1038, __pyx_L1_error)
17975 __Pyx_GOTREF(__pyx_t_2);
17976 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17986 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
17987 __Pyx_GOTREF(__pyx_t_2);
17988 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1039, __pyx_L1_error)
17989 __Pyx_GOTREF(__pyx_t_3);
17990 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17991 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1039, __pyx_L1_error)
17992 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17993 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18003 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18012 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18021 __Pyx_XDECREF(__pyx_r);
18022 __Pyx_INCREF(((PyObject *)__pyx_v_result));
18023 __pyx_r = ((PyObject *)__pyx_v_result);
18036 __Pyx_XDECREF(__pyx_t_2);
18037 __Pyx_XDECREF(__pyx_t_3);
18038 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18041 __Pyx_XDECREF((PyObject *)__pyx_v_result);
18042 __Pyx_XDECREF(__pyx_v_length);
18043 __Pyx_XGIVEREF(__pyx_r);
18044 __Pyx_RefNannyFinishContext();
18056 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18057 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18058 __Pyx_memviewslice *__pyx_r;
18059 __Pyx_RefNannyDeclarations
18062 PyObject *__pyx_t_3 = NULL;
18063 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
18072 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18073 __pyx_t_2 = (__pyx_t_1 != 0);
18083 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1051, __pyx_L1_error)
18084 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18085 __Pyx_INCREF(__pyx_t_3);
18086 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18096 __pyx_r = (&__pyx_v_obj->from_slice);
18116 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18125 __pyx_r = __pyx_v_mslice;
18139 __Pyx_XDECREF(__pyx_t_3);
18140 __Pyx_WriteUnraisable(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18143 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18144 __Pyx_RefNannyFinishContext();
18156 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18158 Py_ssize_t *__pyx_v_shape;
18159 Py_ssize_t *__pyx_v_strides;
18160 Py_ssize_t *__pyx_v_suboffsets;
18161 __Pyx_RefNannyDeclarations
18162 Py_ssize_t *__pyx_t_1;
18166 Py_ssize_t __pyx_t_5;
18167 __Pyx_RefNannySetupContext(
"slice_copy", 0);
18176 __pyx_t_1 = __pyx_v_memview->view.shape;
18177 __pyx_v_shape = __pyx_t_1;
18186 __pyx_t_1 = __pyx_v_memview->view.strides;
18187 __pyx_v_strides = __pyx_t_1;
18196 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18197 __pyx_v_suboffsets = __pyx_t_1;
18206 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
18215 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
18224 __pyx_t_2 = __pyx_v_memview->view.ndim;
18225 __pyx_t_3 = __pyx_t_2;
18226 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18227 __pyx_v_dim = __pyx_t_4;
18236 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18245 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18254 if ((__pyx_v_suboffsets != 0)) {
18255 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18259 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18271 __Pyx_RefNannyFinishContext();
18282 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
18283 __Pyx_memviewslice __pyx_v_memviewslice;
18284 PyObject *__pyx_r = NULL;
18285 __Pyx_RefNannyDeclarations
18286 PyObject *__pyx_t_1 = NULL;
18287 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
18296 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18305 __Pyx_XDECREF(__pyx_r);
18306 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1079, __pyx_L1_error)
18307 __Pyx_GOTREF(__pyx_t_1);
18308 __pyx_r = __pyx_t_1;
18322 __Pyx_XDECREF(__pyx_t_1);
18323 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18326 __Pyx_XGIVEREF(__pyx_r);
18327 __Pyx_RefNannyFinishContext();
18339 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18340 PyObject *(*__pyx_v_to_object_func)(
char *);
18341 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
18342 PyObject *__pyx_r = NULL;
18343 __Pyx_RefNannyDeclarations
18346 PyObject *(*__pyx_t_3)(
char *);
18347 int (*__pyx_t_4)(
char *, PyObject *);
18348 PyObject *__pyx_t_5 = NULL;
18349 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
18358 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18359 __pyx_t_2 = (__pyx_t_1 != 0);
18369 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18370 __pyx_v_to_object_func = __pyx_t_3;
18379 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18380 __pyx_v_to_dtype_func = __pyx_t_4;
18400 __pyx_v_to_object_func = NULL;
18409 __pyx_v_to_dtype_func = NULL;
18420 __Pyx_XDECREF(__pyx_r);
18429 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1096, __pyx_L1_error)
18430 __Pyx_GOTREF(__pyx_t_5);
18431 __pyx_r = __pyx_t_5;
18445 __Pyx_XDECREF(__pyx_t_5);
18446 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18449 __Pyx_XGIVEREF(__pyx_r);
18450 __Pyx_RefNannyFinishContext();
18462 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18463 Py_ssize_t __pyx_r;
18473 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18483 __pyx_r = (-__pyx_v_arg);
18503 __pyx_r = __pyx_v_arg;
18528 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
18530 Py_ssize_t __pyx_v_c_stride;
18531 Py_ssize_t __pyx_v_f_stride;
18545 __pyx_v_c_stride = 0;
18554 __pyx_v_f_stride = 0;
18563 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18564 __pyx_v_i = __pyx_t_1;
18573 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18583 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18592 goto __pyx_L4_break;
18612 __pyx_t_1 = __pyx_v_ndim;
18613 __pyx_t_3 = __pyx_t_1;
18614 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18615 __pyx_v_i = __pyx_t_4;
18624 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18634 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18643 goto __pyx_L7_break;
18663 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18718 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18719 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18720 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18721 Py_ssize_t __pyx_v_dst_extent;
18722 Py_ssize_t __pyx_v_src_stride;
18723 Py_ssize_t __pyx_v_dst_stride;
18727 Py_ssize_t __pyx_t_4;
18728 Py_ssize_t __pyx_t_5;
18729 Py_ssize_t __pyx_t_6;
18738 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18747 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18756 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18765 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18774 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18784 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18787 __pyx_t_1 = __pyx_t_2;
18788 goto __pyx_L5_bool_binop_done;
18790 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18793 __pyx_t_1 = __pyx_t_2;
18794 goto __pyx_L5_bool_binop_done;
18804 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18806 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18808 __pyx_t_3 = (__pyx_t_2 != 0);
18809 __pyx_t_1 = __pyx_t_3;
18810 __pyx_L5_bool_binop_done:;
18828 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18848 __pyx_t_4 = __pyx_v_dst_extent;
18849 __pyx_t_5 = __pyx_t_4;
18850 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18851 __pyx_v_i = __pyx_t_6;
18860 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18869 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18878 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18901 __pyx_t_4 = __pyx_v_dst_extent;
18902 __pyx_t_5 = __pyx_t_4;
18903 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18904 __pyx_v_i = __pyx_t_6;
18913 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18922 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18931 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18955 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18964 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18985 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
18987 Py_ssize_t __pyx_v_size;
18988 Py_ssize_t __pyx_r;
18989 Py_ssize_t __pyx_t_1;
19001 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19002 __pyx_v_size = __pyx_t_1;
19011 __pyx_t_2 = __pyx_v_ndim;
19012 __pyx_t_3 = __pyx_t_2;
19013 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19014 __pyx_v_i = __pyx_t_4;
19023 __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
19033 __pyx_r = __pyx_v_size;
19057 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
19059 Py_ssize_t __pyx_r;
19072 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
19082 __pyx_t_2 = __pyx_v_ndim;
19083 __pyx_t_3 = __pyx_t_2;
19084 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19085 __pyx_v_idx = __pyx_t_4;
19094 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19103 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19124 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19125 __pyx_v_idx = __pyx_t_2;
19134 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19143 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19155 __pyx_r = __pyx_v_stride;
19179 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
19181 void *__pyx_v_result;
19182 size_t __pyx_v_itemsize;
19183 size_t __pyx_v_size;
19185 Py_ssize_t __pyx_t_1;
19188 struct __pyx_memoryview_obj *__pyx_t_4;
19199 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19200 __pyx_v_itemsize = __pyx_t_1;
19209 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19218 __pyx_v_result = malloc(__pyx_v_size);
19227 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19237 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
19255 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
19264 __pyx_t_4 = __pyx_v_src->memview;
19265 __pyx_v_tmpslice->memview = __pyx_t_4;
19274 __pyx_t_3 = __pyx_v_ndim;
19275 __pyx_t_5 = __pyx_t_3;
19276 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19277 __pyx_v_i = __pyx_t_6;
19286 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19295 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
19305 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19314 __pyx_t_3 = __pyx_v_ndim;
19315 __pyx_t_5 = __pyx_t_3;
19316 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19317 __pyx_v_i = __pyx_t_6;
19326 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19336 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19355 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19365 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19385 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19396 __pyx_r = __pyx_v_result;
19411 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19413 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19415 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19431 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19433 __Pyx_RefNannyDeclarations
19434 PyObject *__pyx_t_1 = NULL;
19435 PyObject *__pyx_t_2 = NULL;
19436 PyObject *__pyx_t_3 = NULL;
19437 PyObject *__pyx_t_4 = NULL;
19439 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19441 __Pyx_RefNannySetupContext(
"_err_extents", 0);
19450 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1250, __pyx_L1_error)
19451 __Pyx_GOTREF(__pyx_t_1);
19452 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1250, __pyx_L1_error)
19453 __Pyx_GOTREF(__pyx_t_2);
19454 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error)
19455 __Pyx_GOTREF(__pyx_t_3);
19456 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
19457 __Pyx_GOTREF(__pyx_t_4);
19458 __Pyx_GIVEREF(__pyx_t_1);
19459 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19460 __Pyx_GIVEREF(__pyx_t_2);
19461 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19462 __Pyx_GIVEREF(__pyx_t_3);
19463 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19475 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1249, __pyx_L1_error)
19476 __Pyx_GOTREF(__pyx_t_3);
19477 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19478 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
19479 __Pyx_GOTREF(__pyx_t_4);
19480 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19481 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19482 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19483 __PYX_ERR(1, 1249, __pyx_L1_error)
19495 __Pyx_XDECREF(__pyx_t_1);
19496 __Pyx_XDECREF(__pyx_t_2);
19497 __Pyx_XDECREF(__pyx_t_3);
19498 __Pyx_XDECREF(__pyx_t_4);
19499 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19501 __Pyx_RefNannyFinishContext();
19503 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19516 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
19518 __Pyx_RefNannyDeclarations
19519 PyObject *__pyx_t_1 = NULL;
19520 PyObject *__pyx_t_2 = NULL;
19521 PyObject *__pyx_t_3 = NULL;
19522 PyObject *__pyx_t_4 = NULL;
19523 PyObject *__pyx_t_5 = NULL;
19525 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19527 __Pyx_RefNannySetupContext(
"_err_dim", 0);
19528 __Pyx_INCREF(__pyx_v_error);
19537 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19538 __Pyx_GOTREF(__pyx_t_2);
19539 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19540 __Pyx_GOTREF(__pyx_t_3);
19541 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19542 __Pyx_GOTREF(__pyx_t_4);
19543 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19544 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19545 __Pyx_INCREF(__pyx_v_error);
19546 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19547 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19548 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19549 if (likely(__pyx_t_2)) {
19550 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19551 __Pyx_INCREF(__pyx_t_2);
19552 __Pyx_INCREF(
function);
19553 __Pyx_DECREF_SET(__pyx_t_3,
function);
19557 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19558 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19559 __Pyx_GOTREF(__pyx_t_1);
19561 #if CYTHON_FAST_PYCALL
19562 if (PyFunction_Check(__pyx_t_3)) {
19563 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19564 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19565 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19566 __Pyx_GOTREF(__pyx_t_1);
19567 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19570 #if CYTHON_FAST_PYCCALL
19571 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
19572 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19573 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19574 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19575 __Pyx_GOTREF(__pyx_t_1);
19576 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19580 __pyx_t_5 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1254, __pyx_L1_error)
19581 __Pyx_GOTREF(__pyx_t_5);
19582 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
19583 __Pyx_GIVEREF(__pyx_t_4);
19584 PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
19586 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19587 __Pyx_GOTREF(__pyx_t_1);
19588 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19591 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19592 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19593 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19594 __PYX_ERR(1, 1254, __pyx_L1_error)
19606 __Pyx_XDECREF(__pyx_t_1);
19607 __Pyx_XDECREF(__pyx_t_2);
19608 __Pyx_XDECREF(__pyx_t_3);
19609 __Pyx_XDECREF(__pyx_t_4);
19610 __Pyx_XDECREF(__pyx_t_5);
19611 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19613 __Pyx_XDECREF(__pyx_v_error);
19614 __Pyx_RefNannyFinishContext();
19616 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19629 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
19631 __Pyx_RefNannyDeclarations
19633 PyObject *__pyx_t_2 = NULL;
19634 PyObject *__pyx_t_3 = NULL;
19635 PyObject *__pyx_t_4 = NULL;
19636 PyObject *__pyx_t_5 = NULL;
19637 PyObject *__pyx_t_6 = NULL;
19639 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19641 __Pyx_RefNannySetupContext(
"_err", 0);
19642 __Pyx_INCREF(__pyx_v_error);
19651 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19652 if (unlikely(__pyx_t_1)) {
19661 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1259, __pyx_L1_error)
19662 __Pyx_GOTREF(__pyx_t_3);
19663 __Pyx_INCREF(__pyx_v_error);
19664 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19665 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19666 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19667 if (likely(__pyx_t_5)) {
19668 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
19669 __Pyx_INCREF(__pyx_t_5);
19670 __Pyx_INCREF(
function);
19671 __Pyx_DECREF_SET(__pyx_t_4,
function);
19675 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19677 __Pyx_GOTREF(__pyx_t_2);
19679 #if CYTHON_FAST_PYCALL
19680 if (PyFunction_Check(__pyx_t_4)) {
19681 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19682 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19683 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19684 __Pyx_GOTREF(__pyx_t_2);
19685 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19688 #if CYTHON_FAST_PYCCALL
19689 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
19690 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19691 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19692 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19693 __Pyx_GOTREF(__pyx_t_2);
19694 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19698 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1259, __pyx_L1_error)
19699 __Pyx_GOTREF(__pyx_t_6);
19700 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
19701 __Pyx_GIVEREF(__pyx_t_3);
19702 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
19704 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19705 __Pyx_GOTREF(__pyx_t_2);
19706 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19709 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19710 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19711 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19712 __PYX_ERR(1, 1259, __pyx_L1_error)
19731 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19732 __PYX_ERR(1, 1261, __pyx_L1_error)
19745 __Pyx_XDECREF(__pyx_t_2);
19746 __Pyx_XDECREF(__pyx_t_3);
19747 __Pyx_XDECREF(__pyx_t_4);
19748 __Pyx_XDECREF(__pyx_t_5);
19749 __Pyx_XDECREF(__pyx_t_6);
19750 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19752 __Pyx_XDECREF(__pyx_v_error);
19753 __Pyx_RefNannyFinishContext();
19755 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19768 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
19769 void *__pyx_v_tmpdata;
19770 size_t __pyx_v_itemsize;
19772 char __pyx_v_order;
19773 int __pyx_v_broadcasting;
19774 int __pyx_v_direct_copy;
19775 __Pyx_memviewslice __pyx_v_tmp;
19778 Py_ssize_t __pyx_t_1;
19794 __pyx_v_tmpdata = NULL;
19803 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19804 __pyx_v_itemsize = __pyx_t_1;
19813 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19822 __pyx_v_broadcasting = 0;
19831 __pyx_v_direct_copy = 0;
19840 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19850 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19869 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19879 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19898 __pyx_t_3 = __pyx_v_dst_ndim;
19899 __pyx_t_4 = __pyx_v_src_ndim;
19900 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19901 __pyx_t_5 = __pyx_t_3;
19903 __pyx_t_5 = __pyx_t_4;
19905 __pyx_v_ndim = __pyx_t_5;
19914 __pyx_t_5 = __pyx_v_ndim;
19915 __pyx_t_3 = __pyx_t_5;
19916 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19917 __pyx_v_i = __pyx_t_4;
19926 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19936 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19946 __pyx_v_broadcasting = 1;
19955 (__pyx_v_src.strides[__pyx_v_i]) = 0;
19975 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1293, __pyx_L1_error)
19995 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20005 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1296, __pyx_L1_error)
20024 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20034 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20044 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20062 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1303, __pyx_L1_error)
20063 __pyx_v_tmpdata = __pyx_t_7;
20072 __pyx_v_src = __pyx_v_tmp;
20090 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20100 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
20110 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
20129 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
20139 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
20158 __pyx_t_2 = (__pyx_v_direct_copy != 0);
20168 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20177 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20186 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20195 free(__pyx_v_tmpdata);
20232 __pyx_t_2 = (__pyx_v_order ==
'F');
20234 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20236 __pyx_t_8 = (__pyx_t_2 != 0);
20246 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1325, __pyx_L1_error)
20255 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
20273 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20282 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20291 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20300 free(__pyx_v_tmpdata);
20324 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20326 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20328 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20344 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
20346 int __pyx_v_offset;
20358 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20367 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20368 __pyx_v_i = __pyx_t_1;
20377 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20386 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20395 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20405 __pyx_t_1 = __pyx_v_offset;
20406 __pyx_t_2 = __pyx_t_1;
20407 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20408 __pyx_v_i = __pyx_t_3;
20417 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20426 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20435 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
20457 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
20467 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20477 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20507 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20508 __Pyx_RefNannyDeclarations
20510 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20512 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
20521 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20532 __Pyx_RefNannyFinishContext();
20534 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20546 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20547 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20548 __Pyx_RefNannyDeclarations
20549 Py_ssize_t __pyx_t_1;
20550 Py_ssize_t __pyx_t_2;
20551 Py_ssize_t __pyx_t_3;
20553 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20562 __pyx_t_1 = (__pyx_v_shape[0]);
20563 __pyx_t_2 = __pyx_t_1;
20564 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20565 __pyx_v_i = __pyx_t_3;
20574 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20584 __pyx_t_4 = (__pyx_v_inc != 0);
20594 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20614 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20644 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20655 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20667 __Pyx_RefNannyFinishContext();
20678 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
20687 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20696 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20705 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20726 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
20727 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20728 Py_ssize_t __pyx_v_stride;
20729 Py_ssize_t __pyx_v_extent;
20731 Py_ssize_t __pyx_t_2;
20732 Py_ssize_t __pyx_t_3;
20733 Py_ssize_t __pyx_t_4;
20742 __pyx_v_stride = (__pyx_v_strides[0]);
20751 __pyx_v_extent = (__pyx_v_shape[0]);
20760 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20770 __pyx_t_2 = __pyx_v_extent;
20771 __pyx_t_3 = __pyx_t_2;
20772 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20773 __pyx_v_i = __pyx_t_4;
20782 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20791 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20812 __pyx_t_2 = __pyx_v_extent;
20813 __pyx_t_3 = __pyx_t_2;
20814 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20815 __pyx_v_i = __pyx_t_4;
20824 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20833 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20856 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20857 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20858 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20859 PyObject *__pyx_v___pyx_type = 0;
20860 long __pyx_v___pyx_checksum;
20861 PyObject *__pyx_v___pyx_state = 0;
20862 PyObject *__pyx_r = 0;
20863 __Pyx_RefNannyDeclarations
20864 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
20866 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20867 PyObject* values[3] = {0,0,0};
20868 if (unlikely(__pyx_kwds)) {
20869 Py_ssize_t kw_args;
20870 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20871 switch (pos_args) {
20872 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20873 CYTHON_FALLTHROUGH;
20874 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20875 CYTHON_FALLTHROUGH;
20876 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20877 CYTHON_FALLTHROUGH;
20879 default:
goto __pyx_L5_argtuple_error;
20881 kw_args = PyDict_Size(__pyx_kwds);
20882 switch (pos_args) {
20884 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20885 else goto __pyx_L5_argtuple_error;
20886 CYTHON_FALLTHROUGH;
20888 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20890 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20892 CYTHON_FALLTHROUGH;
20894 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20896 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20899 if (unlikely(kw_args > 0)) {
20900 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20902 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20903 goto __pyx_L5_argtuple_error;
20905 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20906 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20907 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20909 __pyx_v___pyx_type = values[0];
20910 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20911 __pyx_v___pyx_state = values[2];
20913 goto __pyx_L4_argument_unpacking_done;
20914 __pyx_L5_argtuple_error:;
20915 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20917 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20918 __Pyx_RefNannyFinishContext();
20920 __pyx_L4_argument_unpacking_done:;
20921 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20924 __Pyx_RefNannyFinishContext();
20928 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20929 PyObject *__pyx_v___pyx_PickleError = NULL;
20930 PyObject *__pyx_v___pyx_result = NULL;
20931 PyObject *__pyx_r = NULL;
20932 __Pyx_RefNannyDeclarations
20934 PyObject *__pyx_t_2 = NULL;
20935 PyObject *__pyx_t_3 = NULL;
20936 PyObject *__pyx_t_4 = NULL;
20937 PyObject *__pyx_t_5 = NULL;
20938 PyObject *__pyx_t_6 = NULL;
20940 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
20948 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20958 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
20959 __Pyx_GOTREF(__pyx_t_2);
20960 __Pyx_INCREF(__pyx_n_s_PickleError);
20961 __Pyx_GIVEREF(__pyx_n_s_PickleError);
20962 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20963 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
20964 __Pyx_GOTREF(__pyx_t_3);
20965 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20966 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
20967 __Pyx_GOTREF(__pyx_t_2);
20968 __Pyx_INCREF(__pyx_t_2);
20969 __pyx_v___pyx_PickleError = __pyx_t_2;
20970 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20971 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20980 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
20981 __Pyx_GOTREF(__pyx_t_2);
20982 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
20983 __Pyx_GOTREF(__pyx_t_4);
20984 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20985 __Pyx_INCREF(__pyx_v___pyx_PickleError);
20986 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20987 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20988 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20989 if (likely(__pyx_t_5)) {
20990 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
20991 __Pyx_INCREF(__pyx_t_5);
20992 __Pyx_INCREF(
function);
20993 __Pyx_DECREF_SET(__pyx_t_2,
function);
20997 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
20998 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20999 __Pyx_GOTREF(__pyx_t_3);
21001 #if CYTHON_FAST_PYCALL
21002 if (PyFunction_Check(__pyx_t_2)) {
21003 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
21004 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21005 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21006 __Pyx_GOTREF(__pyx_t_3);
21007 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21010 #if CYTHON_FAST_PYCCALL
21011 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
21012 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
21013 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21014 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21015 __Pyx_GOTREF(__pyx_t_3);
21016 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21020 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error)
21021 __Pyx_GOTREF(__pyx_t_6);
21022 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
21023 __Pyx_GIVEREF(__pyx_t_4);
21024 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
21026 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21027 __Pyx_GOTREF(__pyx_t_3);
21028 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21031 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21032 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21033 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21034 __PYX_ERR(1, 4, __pyx_L1_error)
21051 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21052 __Pyx_GOTREF(__pyx_t_2);
21054 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21055 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
21056 if (likely(__pyx_t_6)) {
21057 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
21058 __Pyx_INCREF(__pyx_t_6);
21059 __Pyx_INCREF(
function);
21060 __Pyx_DECREF_SET(__pyx_t_2,
function);
21064 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21065 __Pyx_GOTREF(__pyx_t_3);
21067 #if CYTHON_FAST_PYCALL
21068 if (PyFunction_Check(__pyx_t_2)) {
21069 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
21070 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21071 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21072 __Pyx_GOTREF(__pyx_t_3);
21075 #if CYTHON_FAST_PYCCALL
21076 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
21077 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
21078 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21079 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21080 __Pyx_GOTREF(__pyx_t_3);
21084 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
21085 __Pyx_GOTREF(__pyx_t_4);
21086 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
21087 __Pyx_INCREF(__pyx_v___pyx_type);
21088 __Pyx_GIVEREF(__pyx_v___pyx_type);
21089 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
21090 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21091 __Pyx_GOTREF(__pyx_t_3);
21092 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21095 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21096 __pyx_v___pyx_result = __pyx_t_3;
21106 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21107 __pyx_t_7 = (__pyx_t_1 != 0);
21117 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error)
21118 __pyx_t_3 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21119 __Pyx_GOTREF(__pyx_t_3);
21120 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21138 __Pyx_XDECREF(__pyx_r);
21139 __Pyx_INCREF(__pyx_v___pyx_result);
21140 __pyx_r = __pyx_v___pyx_result;
21151 __Pyx_XDECREF(__pyx_t_2);
21152 __Pyx_XDECREF(__pyx_t_3);
21153 __Pyx_XDECREF(__pyx_t_4);
21154 __Pyx_XDECREF(__pyx_t_5);
21155 __Pyx_XDECREF(__pyx_t_6);
21156 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21159 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21160 __Pyx_XDECREF(__pyx_v___pyx_result);
21161 __Pyx_XGIVEREF(__pyx_r);
21162 __Pyx_RefNannyFinishContext();
21174 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21175 PyObject *__pyx_r = NULL;
21176 __Pyx_RefNannyDeclarations
21177 PyObject *__pyx_t_1 = NULL;
21179 Py_ssize_t __pyx_t_3;
21182 PyObject *__pyx_t_6 = NULL;
21183 PyObject *__pyx_t_7 = NULL;
21184 PyObject *__pyx_t_8 = NULL;
21185 PyObject *__pyx_t_9 = NULL;
21186 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
21195 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21196 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21197 __PYX_ERR(1, 10, __pyx_L1_error)
21199 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
21200 __Pyx_GOTREF(__pyx_t_1);
21201 __Pyx_GIVEREF(__pyx_t_1);
21202 __Pyx_GOTREF(__pyx_v___pyx_result->name);
21203 __Pyx_DECREF(__pyx_v___pyx_result->name);
21204 __pyx_v___pyx_result->name = __pyx_t_1;
21213 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21214 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
21215 __PYX_ERR(1, 11, __pyx_L1_error)
21217 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
21218 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21221 __pyx_t_2 = __pyx_t_4;
21222 goto __pyx_L4_bool_binop_done;
21224 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
21225 __pyx_t_5 = (__pyx_t_4 != 0);
21226 __pyx_t_2 = __pyx_t_5;
21227 __pyx_L4_bool_binop_done:;
21235 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
21236 __Pyx_GOTREF(__pyx_t_6);
21237 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error)
21238 __Pyx_GOTREF(__pyx_t_7);
21239 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21240 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21241 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21242 __PYX_ERR(1, 12, __pyx_L1_error)
21244 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
21245 __Pyx_GOTREF(__pyx_t_6);
21247 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21248 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21249 if (likely(__pyx_t_8)) {
21250 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
21251 __Pyx_INCREF(__pyx_t_8);
21252 __Pyx_INCREF(
function);
21253 __Pyx_DECREF_SET(__pyx_t_7,
function);
21257 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21258 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21259 __Pyx_GOTREF(__pyx_t_1);
21261 #if CYTHON_FAST_PYCALL
21262 if (PyFunction_Check(__pyx_t_7)) {
21263 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
21264 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21265 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21266 __Pyx_GOTREF(__pyx_t_1);
21267 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21270 #if CYTHON_FAST_PYCCALL
21271 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
21272 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
21273 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21274 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21275 __Pyx_GOTREF(__pyx_t_1);
21276 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21280 __pyx_t_9 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error)
21281 __Pyx_GOTREF(__pyx_t_9);
21282 __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
21283 __Pyx_GIVEREF(__pyx_t_6);
21284 PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
21286 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21287 __Pyx_GOTREF(__pyx_t_1);
21288 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21291 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21292 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21311 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21314 __Pyx_XDECREF(__pyx_t_1);
21315 __Pyx_XDECREF(__pyx_t_6);
21316 __Pyx_XDECREF(__pyx_t_7);
21317 __Pyx_XDECREF(__pyx_t_8);
21318 __Pyx_XDECREF(__pyx_t_9);
21319 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21322 __Pyx_XGIVEREF(__pyx_r);
21323 __Pyx_RefNannyFinishContext();
21327 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
21329 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21330 o = (*t->tp_alloc)(t, 0);
21332 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21334 if (unlikely(!o))
return 0;
21335 if (unlikely(__pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(o, a, k) < 0))
goto bad;
21338 Py_DECREF(o); o = 0;
21342 static void __pyx_tp_dealloc_15superluWrappers_cSparseMatrix(PyObject *o) {
21343 #if CYTHON_USE_TP_FINALIZE
21344 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21345 if (PyObject_CallFinalizerFromDealloc(o))
return;
21348 (*Py_TYPE(o)->tp_free)(o);
21351 static PyMethodDef __pyx_methods_15superluWrappers_cSparseMatrix[] = {
21352 {
"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__, METH_NOARGS, 0},
21353 {
"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__, METH_O, 0},
21357 static PyTypeObject __pyx_type_15superluWrappers_cSparseMatrix = {
21358 PyVarObject_HEAD_INIT(0, 0)
21359 "superluWrappers.cSparseMatrix",
21360 sizeof(
struct __pyx_obj_15superluWrappers_cSparseMatrix),
21362 __pyx_tp_dealloc_15superluWrappers_cSparseMatrix,
21366 #
if PY_MAJOR_VERSION < 3
21369 #
if PY_MAJOR_VERSION >= 3
21382 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21390 __pyx_methods_15superluWrappers_cSparseMatrix,
21400 __pyx_tp_new_15superluWrappers_cSparseMatrix,
21410 #
if PY_VERSION_HEX >= 0x030400a1
21414 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor __pyx_vtable_15superluWrappers_SparseFactor;
21416 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21417 struct __pyx_obj_15superluWrappers_SparseFactor *p;
21419 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21420 o = (*t->tp_alloc)(t, 0);
21422 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21424 if (unlikely(!o))
return 0;
21425 p = ((
struct __pyx_obj_15superluWrappers_SparseFactor *)o);
21426 p->__pyx_vtab = __pyx_vtabptr_15superluWrappers_SparseFactor;
21430 static void __pyx_tp_dealloc_15superluWrappers_SparseFactor(PyObject *o) {
21431 #if CYTHON_USE_TP_FINALIZE
21432 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21433 if (PyObject_CallFinalizerFromDealloc(o))
return;
21436 (*Py_TYPE(o)->tp_free)(o);
21439 static PyObject *__pyx_getprop_15superluWrappers_12SparseFactor_dim(PyObject *o, CYTHON_UNUSED
void *x) {
21440 return __pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(o);
21443 static int __pyx_setprop_15superluWrappers_12SparseFactor_dim(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21445 return __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(o,
v);
21448 PyErr_SetString(PyExc_NotImplementedError,
"__del__");
21453 static PyMethodDef __pyx_methods_15superluWrappers_SparseFactor[] = {
21454 {
"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__, METH_NOARGS, 0},
21455 {
"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__, METH_O, 0},
21459 static struct PyGetSetDef __pyx_getsets_15superluWrappers_SparseFactor[] = {
21460 {(
char *)
"dim", __pyx_getprop_15superluWrappers_12SparseFactor_dim, __pyx_setprop_15superluWrappers_12SparseFactor_dim, (
char *)0, 0},
21464 static PyTypeObject __pyx_type_15superluWrappers_SparseFactor = {
21465 PyVarObject_HEAD_INIT(0, 0)
21466 "superluWrappers.SparseFactor",
21467 sizeof(
struct __pyx_obj_15superluWrappers_SparseFactor),
21469 __pyx_tp_dealloc_15superluWrappers_SparseFactor,
21473 #
if PY_MAJOR_VERSION < 3
21476 #
if PY_MAJOR_VERSION >= 3
21489 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21497 __pyx_methods_15superluWrappers_SparseFactor,
21499 __pyx_getsets_15superluWrappers_SparseFactor,
21505 __pyx_pw_15superluWrappers_12SparseFactor_1__init__,
21507 __pyx_tp_new_15superluWrappers_SparseFactor,
21517 #
if PY_VERSION_HEX >= 0x030400a1
21521 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21523 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21524 struct __pyx_array_obj *p;
21526 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21527 o = (*t->tp_alloc)(t, 0);
21529 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21531 if (unlikely(!o))
return 0;
21532 p = ((
struct __pyx_array_obj *)o);
21533 p->__pyx_vtab = __pyx_vtabptr_array;
21534 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21535 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21536 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
21539 Py_DECREF(o); o = 0;
21543 static void __pyx_tp_dealloc_array(PyObject *o) {
21544 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
21545 #if CYTHON_USE_TP_FINALIZE
21546 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21547 if (PyObject_CallFinalizerFromDealloc(o))
return;
21551 PyObject *etype, *eval, *etb;
21552 PyErr_Fetch(&etype, &eval, &etb);
21554 __pyx_array___dealloc__(o);
21556 PyErr_Restore(etype, eval, etb);
21559 Py_CLEAR(p->_format);
21560 (*Py_TYPE(o)->tp_free)(o);
21562 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21564 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21565 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21570 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
21572 return __pyx_array___setitem__(o, i,
v);
21575 PyErr_Format(PyExc_NotImplementedError,
21576 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21581 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
21582 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
21583 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21585 v = __pyx_array___getattr__(o,
n);
21590 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
21591 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21594 static PyMethodDef __pyx_methods_array[] = {
21595 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21596 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21597 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21601 static struct PyGetSetDef __pyx_getsets_array[] = {
21602 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
21606 static PySequenceMethods __pyx_tp_as_sequence_array = {
21607 __pyx_array___len__,
21610 __pyx_sq_item_array,
21619 static PyMappingMethods __pyx_tp_as_mapping_array = {
21620 __pyx_array___len__,
21621 __pyx_array___getitem__,
21622 __pyx_mp_ass_subscript_array,
21625 static PyBufferProcs __pyx_tp_as_buffer_array = {
21626 #if PY_MAJOR_VERSION < 3
21629 #if PY_MAJOR_VERSION < 3
21632 #if PY_MAJOR_VERSION < 3
21635 #if PY_MAJOR_VERSION < 3
21638 __pyx_array_getbuffer,
21642 static PyTypeObject __pyx_type___pyx_array = {
21643 PyVarObject_HEAD_INIT(0, 0)
21644 "superluWrappers.array",
21645 sizeof(
struct __pyx_array_obj),
21647 __pyx_tp_dealloc_array,
21651 #
if PY_MAJOR_VERSION < 3
21654 #
if PY_MAJOR_VERSION >= 3
21659 &__pyx_tp_as_sequence_array,
21660 &__pyx_tp_as_mapping_array,
21664 __pyx_tp_getattro_array,
21666 &__pyx_tp_as_buffer_array,
21667 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21675 __pyx_methods_array,
21677 __pyx_getsets_array,
21685 __pyx_tp_new_array,
21695 #
if PY_VERSION_HEX >= 0x030400a1
21700 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21701 struct __pyx_MemviewEnum_obj *p;
21703 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21704 o = (*t->tp_alloc)(t, 0);
21706 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21708 if (unlikely(!o))
return 0;
21709 p = ((
struct __pyx_MemviewEnum_obj *)o);
21710 p->name = Py_None; Py_INCREF(Py_None);
21714 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21715 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21716 #if CYTHON_USE_TP_FINALIZE
21717 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21718 if (PyObject_CallFinalizerFromDealloc(o))
return;
21721 PyObject_GC_UnTrack(o);
21723 (*Py_TYPE(o)->tp_free)(o);
21726 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
21728 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21730 e = (*v)(p->name, a);
if (e)
return e;
21735 static int __pyx_tp_clear_Enum(PyObject *o) {
21737 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21738 tmp = ((PyObject*)p->name);
21739 p->name = Py_None; Py_INCREF(Py_None);
21744 static PyMethodDef __pyx_methods_Enum[] = {
21745 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21746 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21750 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21751 PyVarObject_HEAD_INIT(0, 0)
21752 "superluWrappers.Enum",
21753 sizeof(
struct __pyx_MemviewEnum_obj),
21755 __pyx_tp_dealloc_Enum,
21759 #
if PY_MAJOR_VERSION < 3
21762 #
if PY_MAJOR_VERSION >= 3
21765 __pyx_MemviewEnum___repr__,
21775 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21777 __pyx_tp_traverse_Enum,
21778 __pyx_tp_clear_Enum,
21783 __pyx_methods_Enum,
21791 __pyx_MemviewEnum___init__,
21803 #
if PY_VERSION_HEX >= 0x030400a1
21807 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21809 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21810 struct __pyx_memoryview_obj *p;
21812 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21813 o = (*t->tp_alloc)(t, 0);
21815 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21817 if (unlikely(!o))
return 0;
21818 p = ((
struct __pyx_memoryview_obj *)o);
21819 p->__pyx_vtab = __pyx_vtabptr_memoryview;
21820 p->obj = Py_None; Py_INCREF(Py_None);
21821 p->_size = Py_None; Py_INCREF(Py_None);
21822 p->_array_interface = Py_None; Py_INCREF(Py_None);
21823 p->view.obj = NULL;
21824 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
21827 Py_DECREF(o); o = 0;
21831 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21832 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21833 #if CYTHON_USE_TP_FINALIZE
21834 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21835 if (PyObject_CallFinalizerFromDealloc(o))
return;
21838 PyObject_GC_UnTrack(o);
21840 PyObject *etype, *eval, *etb;
21841 PyErr_Fetch(&etype, &eval, &etb);
21843 __pyx_memoryview___dealloc__(o);
21845 PyErr_Restore(etype, eval, etb);
21848 Py_CLEAR(p->_size);
21849 Py_CLEAR(p->_array_interface);
21850 (*Py_TYPE(o)->tp_free)(o);
21853 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
21855 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21857 e = (*v)(p->obj, a);
if (e)
return e;
21860 e = (*v)(p->_size, a);
if (e)
return e;
21862 if (p->_array_interface) {
21863 e = (*v)(p->_array_interface, a);
if (e)
return e;
21866 e = (*v)(p->view.obj, a);
if (e)
return e;
21871 static int __pyx_tp_clear_memoryview(PyObject *o) {
21873 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21874 tmp = ((PyObject*)p->obj);
21875 p->obj = Py_None; Py_INCREF(Py_None);
21877 tmp = ((PyObject*)p->_size);
21878 p->_size = Py_None; Py_INCREF(Py_None);
21880 tmp = ((PyObject*)p->_array_interface);
21881 p->_array_interface = Py_None; Py_INCREF(Py_None);
21883 Py_CLEAR(p->view.obj);
21886 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21888 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21889 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21894 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
21896 return __pyx_memoryview___setitem__(o, i,
v);
21899 PyErr_Format(PyExc_NotImplementedError,
21900 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21905 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
21906 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21909 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
21910 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21913 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
21914 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21917 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
21918 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21921 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
21922 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21925 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
21926 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21929 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
21930 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21933 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
21934 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21937 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
21938 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21941 static PyMethodDef __pyx_methods_memoryview[] = {
21942 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21943 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21944 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21945 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21946 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21947 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21951 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21952 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
21953 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
21954 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
21955 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
21956 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
21957 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
21958 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
21959 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
21960 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
21964 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21965 __pyx_memoryview___len__,
21968 __pyx_sq_item_memoryview,
21977 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21978 __pyx_memoryview___len__,
21979 __pyx_memoryview___getitem__,
21980 __pyx_mp_ass_subscript_memoryview,
21983 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21984 #if PY_MAJOR_VERSION < 3
21987 #if PY_MAJOR_VERSION < 3
21990 #if PY_MAJOR_VERSION < 3
21993 #if PY_MAJOR_VERSION < 3
21996 __pyx_memoryview_getbuffer,
22000 static PyTypeObject __pyx_type___pyx_memoryview = {
22001 PyVarObject_HEAD_INIT(0, 0)
22002 "superluWrappers.memoryview",
22003 sizeof(
struct __pyx_memoryview_obj),
22005 __pyx_tp_dealloc_memoryview,
22009 #
if PY_MAJOR_VERSION < 3
22012 #
if PY_MAJOR_VERSION >= 3
22015 __pyx_memoryview___repr__,
22017 &__pyx_tp_as_sequence_memoryview,
22018 &__pyx_tp_as_mapping_memoryview,
22021 __pyx_memoryview___str__,
22024 &__pyx_tp_as_buffer_memoryview,
22025 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22027 __pyx_tp_traverse_memoryview,
22028 __pyx_tp_clear_memoryview,
22033 __pyx_methods_memoryview,
22035 __pyx_getsets_memoryview,
22043 __pyx_tp_new_memoryview,
22053 #
if PY_VERSION_HEX >= 0x030400a1
22057 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22059 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22060 struct __pyx_memoryviewslice_obj *p;
22061 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22062 if (unlikely(!o))
return 0;
22063 p = ((
struct __pyx_memoryviewslice_obj *)o);
22064 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22065 p->from_object = Py_None; Py_INCREF(Py_None);
22066 p->from_slice.memview = NULL;
22070 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22071 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22072 #if CYTHON_USE_TP_FINALIZE
22073 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22074 if (PyObject_CallFinalizerFromDealloc(o))
return;
22077 PyObject_GC_UnTrack(o);
22079 PyObject *etype, *eval, *etb;
22080 PyErr_Fetch(&etype, &eval, &etb);
22082 __pyx_memoryviewslice___dealloc__(o);
22084 PyErr_Restore(etype, eval, etb);
22086 Py_CLEAR(p->from_object);
22087 PyObject_GC_Track(o);
22088 __pyx_tp_dealloc_memoryview(o);
22091 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
22093 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22094 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
22095 if (p->from_object) {
22096 e = (*v)(p->from_object, a);
if (e)
return e;
22101 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22103 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22104 __pyx_tp_clear_memoryview(o);
22105 tmp = ((PyObject*)p->from_object);
22106 p->from_object = Py_None; Py_INCREF(Py_None);
22108 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22112 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
22113 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22116 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22117 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22118 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22122 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22123 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
22127 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22128 PyVarObject_HEAD_INIT(0, 0)
22129 "superluWrappers._memoryviewslice",
22130 sizeof(
struct __pyx_memoryviewslice_obj),
22132 __pyx_tp_dealloc__memoryviewslice,
22136 #
if PY_MAJOR_VERSION < 3
22139 #
if PY_MAJOR_VERSION >= 3
22142 #
if CYTHON_COMPILING_IN_PYPY
22143 __pyx_memoryview___repr__,
22152 #
if CYTHON_COMPILING_IN_PYPY
22153 __pyx_memoryview___str__,
22160 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22161 "Internal class for passing memoryview slices to Python",
22162 __pyx_tp_traverse__memoryviewslice,
22163 __pyx_tp_clear__memoryviewslice,
22168 __pyx_methods__memoryviewslice,
22170 __pyx_getsets__memoryviewslice,
22178 __pyx_tp_new__memoryviewslice,
22188 #
if PY_VERSION_HEX >= 0x030400a1
22193 static PyMethodDef __pyx_methods[] = {
22197 #if PY_MAJOR_VERSION >= 3
22198 #if CYTHON_PEP489_MULTI_PHASE_INIT
22199 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22200 static int __pyx_pymod_exec_superluWrappers(PyObject* module);
22201 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22202 {Py_mod_create, (
void*)__pyx_pymod_create},
22203 {Py_mod_exec, (
void*)__pyx_pymod_exec_superluWrappers},
22208 static struct PyModuleDef __pyx_moduledef = {
22209 PyModuleDef_HEAD_INIT,
22212 #if CYTHON_PEP489_MULTI_PHASE_INIT
22218 #if CYTHON_PEP489_MULTI_PHASE_INIT
22219 __pyx_moduledef_slots,
22229 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22230 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22231 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22232 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22233 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22234 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22235 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22236 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22237 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22238 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22239 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22240 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22241 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22242 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22243 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22244 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22245 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22246 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22247 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22248 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22249 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22250 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
22251 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22252 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22253 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22254 {&__pyx_n_s_SparseMatrix, __pyx_k_SparseMatrix,
sizeof(__pyx_k_SparseMatrix), 0, 0, 1, 1},
22255 {&__pyx_n_s_SparseMatrix___init, __pyx_k_SparseMatrix___init,
sizeof(__pyx_k_SparseMatrix___init), 0, 0, 1, 1},
22256 {&__pyx_n_s_SparseMatrix_fwrite, __pyx_k_SparseMatrix_fwrite,
sizeof(__pyx_k_SparseMatrix_fwrite), 0, 0, 1, 1},
22257 {&__pyx_n_s_SparseMatrix_getCSRrepresentatio, __pyx_k_SparseMatrix_getCSRrepresentatio,
sizeof(__pyx_k_SparseMatrix_getCSRrepresentatio), 0, 0, 1, 1},
22258 {&__pyx_n_s_SparseMatrix_getSubMatCSRreprese, __pyx_k_SparseMatrix_getSubMatCSRreprese,
sizeof(__pyx_k_SparseMatrix_getSubMatCSRreprese), 0, 0, 1, 1},
22259 {&__pyx_n_s_SparseMatrix_matvec, __pyx_k_SparseMatrix_matvec,
sizeof(__pyx_k_SparseMatrix_matvec), 0, 0, 1, 1},
22260 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22261 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22262 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22263 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22264 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22265 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
22266 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
22267 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
22268 {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix,
sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
22269 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
22270 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22271 {&__pyx_n_s_colind, __pyx_k_colind,
sizeof(__pyx_k_colind), 0, 0, 1, 1},
22272 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22273 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22274 {&__pyx_kp_s_d_d_13_8e, __pyx_k_d_d_13_8e,
sizeof(__pyx_k_d_d_13_8e), 0, 0, 1, 0},
22275 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
22276 {&__pyx_n_s_dim, __pyx_k_dim,
sizeof(__pyx_k_dim), 0, 0, 1, 1},
22277 {&__pyx_n_s_doc, __pyx_k_doc,
sizeof(__pyx_k_doc), 0, 0, 1, 1},
22278 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22279 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
22280 {&__pyx_n_s_enter, __pyx_k_enter,
sizeof(__pyx_k_enter), 0, 0, 1, 1},
22281 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22282 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
22283 {&__pyx_n_s_exit, __pyx_k_exit,
sizeof(__pyx_k_exit), 0, 0, 1, 1},
22284 {&__pyx_n_s_filename, __pyx_k_filename,
sizeof(__pyx_k_filename), 0, 0, 1, 1},
22285 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
22286 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
22287 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22288 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22289 {&__pyx_n_s_fwrite, __pyx_k_fwrite,
sizeof(__pyx_k_fwrite), 0, 0, 1, 1},
22290 {&__pyx_n_s_getCSRrepresentation, __pyx_k_getCSRrepresentation,
sizeof(__pyx_k_getCSRrepresentation), 0, 0, 1, 1},
22291 {&__pyx_n_s_getSubMatCSRrepresentation, __pyx_k_getSubMatCSRrepresentation,
sizeof(__pyx_k_getSubMatCSRrepresentation), 0, 0, 1, 1},
22292 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22293 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22294 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
22295 {&__pyx_kp_s_i_i_i, __pyx_k_i_i_i,
sizeof(__pyx_k_i_i_i), 0, 0, 1, 0},
22296 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
22297 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22298 {&__pyx_n_s_init, __pyx_k_init,
sizeof(__pyx_k_init), 0, 0, 1, 1},
22299 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22300 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22301 {&__pyx_n_s_k, __pyx_k_k,
sizeof(__pyx_k_k), 0, 0, 1, 1},
22302 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22303 {&__pyx_n_s_matvec, __pyx_k_matvec,
sizeof(__pyx_k_matvec), 0, 0, 1, 1},
22304 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
22305 {&__pyx_n_s_metaclass, __pyx_k_metaclass,
sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
22306 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
22307 {&__pyx_n_s_module, __pyx_k_module,
sizeof(__pyx_k_module), 0, 0, 1, 1},
22308 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22309 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22310 {&__pyx_n_s_nc, __pyx_k_nc,
sizeof(__pyx_k_nc), 0, 0, 1, 1},
22311 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
22312 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
22313 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22314 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
22315 {&__pyx_n_s_nnz, __pyx_k_nnz,
sizeof(__pyx_k_nnz), 0, 0, 1, 1},
22316 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22317 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
22318 {&__pyx_n_s_nr, __pyx_k_nr,
sizeof(__pyx_k_nr), 0, 0, 1, 1},
22319 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22320 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22321 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22322 {&__pyx_n_s_nzval, __pyx_k_nzval,
sizeof(__pyx_k_nzval), 0, 0, 1, 1},
22323 {&__pyx_n_s_nzvals, __pyx_k_nzvals,
sizeof(__pyx_k_nzvals), 0, 0, 1, 1},
22324 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
22325 {&__pyx_n_s_object, __pyx_k_object,
sizeof(__pyx_k_object), 0, 0, 1, 1},
22326 {&__pyx_n_s_open, __pyx_k_open,
sizeof(__pyx_k_open), 0, 0, 1, 1},
22327 {&__pyx_n_s_output_file, __pyx_k_output_file,
sizeof(__pyx_k_output_file), 0, 0, 1, 1},
22328 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
22329 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22330 {&__pyx_n_s_prepare, __pyx_k_prepare,
sizeof(__pyx_k_prepare), 0, 0, 1, 1},
22331 {&__pyx_kp_s_proteus_superluWrappers_pyx, __pyx_k_proteus_superluWrappers_pyx,
sizeof(__pyx_k_proteus_superluWrappers_pyx), 0, 0, 1, 0},
22332 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22333 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22334 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22335 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22336 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22337 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22338 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22339 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22340 {&__pyx_n_s_qualname, __pyx_k_qualname,
sizeof(__pyx_k_qualname), 0, 0, 1, 1},
22341 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22342 {&__pyx_n_s_range_end, __pyx_k_range_end,
sizeof(__pyx_k_range_end), 0, 0, 1, 1},
22343 {&__pyx_n_s_range_start, __pyx_k_range_start,
sizeof(__pyx_k_range_start), 0, 0, 1, 1},
22344 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22345 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22346 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22347 {&__pyx_n_s_rowptr, __pyx_k_rowptr,
sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
22348 {&__pyx_n_s_rows, __pyx_k_rows,
sizeof(__pyx_k_rows), 0, 0, 1, 1},
22349 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
22350 {&__pyx_kp_s_self_A_self_AC_self_L_self_U_sel, __pyx_k_self_A_self_AC_self_L_self_U_sel,
sizeof(__pyx_k_self_A_self_AC_self_L_self_U_sel), 0, 0, 1, 0},
22351 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22352 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22353 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22354 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
22355 {&__pyx_n_s_sparseFactor, __pyx_k_sparseFactor,
sizeof(__pyx_k_sparseFactor), 0, 0, 1, 1},
22356 {&__pyx_n_s_sparseFactorPrepare, __pyx_k_sparseFactorPrepare,
sizeof(__pyx_k_sparseFactorPrepare), 0, 0, 1, 1},
22357 {&__pyx_n_s_sparseFactorSolve, __pyx_k_sparseFactorSolve,
sizeof(__pyx_k_sparseFactorSolve), 0, 0, 1, 1},
22358 {&__pyx_n_s_sparse_matrix, __pyx_k_sparse_matrix,
sizeof(__pyx_k_sparse_matrix), 0, 0, 1, 1},
22359 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
22360 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
22361 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
22362 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22363 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22364 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22365 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22366 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
22367 {&__pyx_n_s_superluWrappers, __pyx_k_superluWrappers,
sizeof(__pyx_k_superluWrappers), 0, 0, 1, 1},
22368 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22369 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22370 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22371 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22372 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22373 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
22374 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
22375 {&__pyx_n_s_write, __pyx_k_write,
sizeof(__pyx_k_write), 0, 0, 1, 1},
22376 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
22377 {&__pyx_n_s_y, __pyx_k_y,
sizeof(__pyx_k_y), 0, 0, 1, 1},
22378 {0, 0, 0, 0, 0, 0, 0}
22380 static int __Pyx_InitCachedBuiltins(
void) {
22381 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object);
if (!__pyx_builtin_object) __PYX_ERR(0, 13, __pyx_L1_error)
22382 __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open);
if (!__pyx_builtin_open) __PYX_ERR(0, 56, __pyx_L1_error)
22383 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 58, __pyx_L1_error)
22384 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22385 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(2, 229, __pyx_L1_error)
22386 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 810, __pyx_L1_error)
22387 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1000, __pyx_L1_error)
22388 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 147, __pyx_L1_error)
22389 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 150, __pyx_L1_error)
22390 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 399, __pyx_L1_error)
22391 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 608, __pyx_L1_error)
22392 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 827, __pyx_L1_error)
22398 static int __Pyx_InitCachedConstants(
void) {
22399 __Pyx_RefNannyDeclarations
22400 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22409 __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 56, __pyx_L1_error)
22410 __Pyx_GOTREF(__pyx_tuple_);
22411 __Pyx_GIVEREF(__pyx_tuple_);
22419 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 2, __pyx_L1_error)
22420 __Pyx_GOTREF(__pyx_tuple__2);
22421 __Pyx_GIVEREF(__pyx_tuple__2);
22428 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error)
22429 __Pyx_GOTREF(__pyx_tuple__3);
22430 __Pyx_GIVEREF(__pyx_tuple__3);
22438 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
22439 __Pyx_GOTREF(__pyx_tuple__4);
22440 __Pyx_GIVEREF(__pyx_tuple__4);
22447 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
22448 __Pyx_GOTREF(__pyx_tuple__5);
22449 __Pyx_GIVEREF(__pyx_tuple__5);
22458 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 229, __pyx_L1_error)
22459 __Pyx_GOTREF(__pyx_tuple__6);
22460 __Pyx_GIVEREF(__pyx_tuple__6);
22469 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 233, __pyx_L1_error)
22470 __Pyx_GOTREF(__pyx_tuple__7);
22471 __Pyx_GIVEREF(__pyx_tuple__7);
22480 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 263, __pyx_L1_error)
22481 __Pyx_GOTREF(__pyx_tuple__8);
22482 __Pyx_GIVEREF(__pyx_tuple__8);
22491 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 810, __pyx_L1_error)
22492 __Pyx_GOTREF(__pyx_tuple__9);
22493 __Pyx_GIVEREF(__pyx_tuple__9);
22502 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 814, __pyx_L1_error)
22503 __Pyx_GOTREF(__pyx_tuple__10);
22504 __Pyx_GIVEREF(__pyx_tuple__10);
22513 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 834, __pyx_L1_error)
22514 __Pyx_GOTREF(__pyx_tuple__11);
22515 __Pyx_GIVEREF(__pyx_tuple__11);
22524 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 1000, __pyx_L1_error)
22525 __Pyx_GOTREF(__pyx_tuple__12);
22526 __Pyx_GIVEREF(__pyx_tuple__12);
22535 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 1006, __pyx_L1_error)
22536 __Pyx_GOTREF(__pyx_tuple__13);
22537 __Pyx_GIVEREF(__pyx_tuple__13);
22544 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 1012, __pyx_L1_error)
22545 __Pyx_GOTREF(__pyx_tuple__14);
22546 __Pyx_GIVEREF(__pyx_tuple__14);
22555 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 132, __pyx_L1_error)
22556 __Pyx_GOTREF(__pyx_tuple__15);
22557 __Pyx_GIVEREF(__pyx_tuple__15);
22566 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 135, __pyx_L1_error)
22567 __Pyx_GOTREF(__pyx_tuple__16);
22568 __Pyx_GIVEREF(__pyx_tuple__16);
22577 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_ASCII);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 138, __pyx_L1_error)
22578 __Pyx_GOTREF(__pyx_tuple__17);
22579 __Pyx_GIVEREF(__pyx_tuple__17);
22588 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 147, __pyx_L1_error)
22589 __Pyx_GOTREF(__pyx_tuple__18);
22590 __Pyx_GIVEREF(__pyx_tuple__18);
22599 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 175, __pyx_L1_error)
22600 __Pyx_GOTREF(__pyx_tuple__19);
22601 __Pyx_GIVEREF(__pyx_tuple__19);
22610 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 191, __pyx_L1_error)
22611 __Pyx_GOTREF(__pyx_tuple__20);
22612 __Pyx_GIVEREF(__pyx_tuple__20);
22620 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 2, __pyx_L1_error)
22621 __Pyx_GOTREF(__pyx_tuple__21);
22622 __Pyx_GIVEREF(__pyx_tuple__21);
22629 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 4, __pyx_L1_error)
22630 __Pyx_GOTREF(__pyx_tuple__22);
22631 __Pyx_GIVEREF(__pyx_tuple__22);
22640 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 413, __pyx_L1_error)
22641 __Pyx_GOTREF(__pyx_tuple__23);
22642 __Pyx_GIVEREF(__pyx_tuple__23);
22651 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 490, __pyx_L1_error)
22652 __Pyx_GOTREF(__pyx_tuple__24);
22653 __Pyx_GIVEREF(__pyx_tuple__24);
22662 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 515, __pyx_L1_error)
22663 __Pyx_GOTREF(__pyx_tuple__25);
22664 __Pyx_GIVEREF(__pyx_tuple__25);
22673 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 565, __pyx_L1_error)
22674 __Pyx_GOTREF(__pyx_tuple__26);
22675 __Pyx_GIVEREF(__pyx_tuple__26);
22684 __pyx_tuple__27 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 572, __pyx_L1_error)
22685 __Pyx_GOTREF(__pyx_tuple__27);
22686 __Pyx_INCREF(__pyx_int_neg_1);
22687 __Pyx_GIVEREF(__pyx_int_neg_1);
22688 PyTuple_SET_ITEM(__pyx_tuple__27, 0, __pyx_int_neg_1);
22689 __Pyx_GIVEREF(__pyx_tuple__27);
22697 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 2, __pyx_L1_error)
22698 __Pyx_GOTREF(__pyx_tuple__28);
22699 __Pyx_GIVEREF(__pyx_tuple__28);
22706 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 4, __pyx_L1_error)
22707 __Pyx_GOTREF(__pyx_tuple__29);
22708 __Pyx_GIVEREF(__pyx_tuple__29);
22717 __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__30)) __PYX_ERR(1, 677, __pyx_L1_error)
22718 __Pyx_GOTREF(__pyx_slice__30);
22719 __Pyx_GIVEREF(__pyx_slice__30);
22728 __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__31)) __PYX_ERR(1, 680, __pyx_L1_error)
22729 __Pyx_GOTREF(__pyx_slice__31);
22730 __Pyx_GIVEREF(__pyx_slice__31);
22739 __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__32)) __PYX_ERR(1, 691, __pyx_L1_error)
22740 __Pyx_GOTREF(__pyx_slice__32);
22741 __Pyx_GIVEREF(__pyx_slice__32);
22750 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 698, __pyx_L1_error)
22751 __Pyx_GOTREF(__pyx_tuple__33);
22752 __Pyx_GIVEREF(__pyx_tuple__33);
22760 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
22761 __Pyx_GOTREF(__pyx_tuple__34);
22762 __Pyx_GIVEREF(__pyx_tuple__34);
22769 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
22770 __Pyx_GOTREF(__pyx_tuple__35);
22771 __Pyx_GIVEREF(__pyx_tuple__35);
22780 __pyx_tuple__36 = PyTuple_Pack(1, __pyx_builtin_object);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 13, __pyx_L1_error)
22781 __Pyx_GOTREF(__pyx_tuple__36);
22782 __Pyx_GIVEREF(__pyx_tuple__36);
22791 __pyx_tuple__37 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_nr, __pyx_n_s_nc, __pyx_n_s_nnz, __pyx_n_s_nzvals, __pyx_n_s_colind, __pyx_n_s_rowptr);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 15, __pyx_L1_error)
22792 __Pyx_GOTREF(__pyx_tuple__37);
22793 __Pyx_GIVEREF(__pyx_tuple__37);
22794 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_init, 15, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 15, __pyx_L1_error)
22803 __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 35, __pyx_L1_error)
22804 __Pyx_GOTREF(__pyx_tuple__39);
22805 __Pyx_GIVEREF(__pyx_tuple__39);
22806 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_matvec, 35, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 35, __pyx_L1_error)
22815 __pyx_tuple__41 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_base, __pyx_n_s_output_file, __pyx_n_s_i, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 46, __pyx_L1_error)
22816 __Pyx_GOTREF(__pyx_tuple__41);
22817 __Pyx_GIVEREF(__pyx_tuple__41);
22818 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_fwrite, 46, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 46, __pyx_L1_error)
22827 __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 62, __pyx_L1_error)
22828 __Pyx_GOTREF(__pyx_tuple__43);
22829 __Pyx_GIVEREF(__pyx_tuple__43);
22830 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getCSRrepresentation, 62, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 62, __pyx_L1_error)
22839 __pyx_tuple__45 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_range_start, __pyx_n_s_range_end, __pyx_n_s_rows, __pyx_n_s_nnz, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nzvals);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 72, __pyx_L1_error)
22840 __Pyx_GOTREF(__pyx_tuple__45);
22841 __Pyx_GIVEREF(__pyx_tuple__45);
22842 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getSubMatCSRrepresentation, 72, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 72, __pyx_L1_error)
22851 __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_sparse_matrix, __pyx_n_s_sparseFactor);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 219, __pyx_L1_error)
22852 __Pyx_GOTREF(__pyx_tuple__47);
22853 __Pyx_GIVEREF(__pyx_tuple__47);
22854 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorPrepare, 219, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 219, __pyx_L1_error)
22863 __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_sparseFactor, __pyx_n_s_x);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 286, __pyx_L1_error)
22864 __Pyx_GOTREF(__pyx_tuple__49);
22865 __Pyx_GIVEREF(__pyx_tuple__49);
22866 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorSolve, 286, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 286, __pyx_L1_error)
22875 __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 285, __pyx_L1_error)
22876 __Pyx_GOTREF(__pyx_tuple__51);
22877 __Pyx_GIVEREF(__pyx_tuple__51);
22886 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 286, __pyx_L1_error)
22887 __Pyx_GOTREF(__pyx_tuple__52);
22888 __Pyx_GIVEREF(__pyx_tuple__52);
22897 __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 287, __pyx_L1_error)
22898 __Pyx_GOTREF(__pyx_tuple__53);
22899 __Pyx_GIVEREF(__pyx_tuple__53);
22908 __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 290, __pyx_L1_error)
22909 __Pyx_GOTREF(__pyx_tuple__54);
22910 __Pyx_GIVEREF(__pyx_tuple__54);
22919 __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 291, __pyx_L1_error)
22920 __Pyx_GOTREF(__pyx_tuple__55);
22921 __Pyx_GIVEREF(__pyx_tuple__55);
22928 __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 1, __pyx_L1_error)
22929 __Pyx_GOTREF(__pyx_tuple__56);
22930 __Pyx_GIVEREF(__pyx_tuple__56);
22931 __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(1, 1, __pyx_L1_error)
22932 __Pyx_RefNannyFinishContext();
22935 __Pyx_RefNannyFinishContext();
22939 static int __Pyx_InitGlobals(
void) {
22940 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22941 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22942 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22943 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22944 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22950 static int __Pyx_modinit_global_init_code(
void);
22951 static int __Pyx_modinit_variable_export_code(
void);
22952 static int __Pyx_modinit_function_export_code(
void);
22953 static int __Pyx_modinit_type_init_code(
void);
22954 static int __Pyx_modinit_type_import_code(
void);
22955 static int __Pyx_modinit_variable_import_code(
void);
22956 static int __Pyx_modinit_function_import_code(
void);
22958 static int __Pyx_modinit_global_init_code(
void) {
22959 __Pyx_RefNannyDeclarations
22960 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
22962 generic = Py_None; Py_INCREF(Py_None);
22963 strided = Py_None; Py_INCREF(Py_None);
22964 indirect = Py_None; Py_INCREF(Py_None);
22965 contiguous = Py_None; Py_INCREF(Py_None);
22966 indirect_contiguous = Py_None; Py_INCREF(Py_None);
22967 __Pyx_RefNannyFinishContext();
22971 static int __Pyx_modinit_variable_export_code(
void) {
22972 __Pyx_RefNannyDeclarations
22973 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
22975 __Pyx_RefNannyFinishContext();
22979 static int __Pyx_modinit_function_export_code(
void) {
22980 __Pyx_RefNannyDeclarations
22981 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
22983 __Pyx_RefNannyFinishContext();
22987 static int __Pyx_modinit_type_init_code(
void) {
22988 __Pyx_RefNannyDeclarations
22989 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
22991 if (PyType_Ready(&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22992 __pyx_type_15superluWrappers_cSparseMatrix.tp_print = 0;
22993 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_cSparseMatrix.tp_dictoffset && __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro == PyObject_GenericGetAttr)) {
22994 __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22996 if (PyObject_SetAttrString(__pyx_m,
"cSparseMatrix", (PyObject *)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22997 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22998 __pyx_ptype_15superluWrappers_cSparseMatrix = &__pyx_type_15superluWrappers_cSparseMatrix;
22999 __pyx_vtabptr_15superluWrappers_SparseFactor = &__pyx_vtable_15superluWrappers_SparseFactor;
23000 __pyx_vtable_15superluWrappers_SparseFactor._set_mat_types = (PyObject *(*)(
struct __pyx_obj_15superluWrappers_SparseFactor *))__pyx_f_15superluWrappers_12SparseFactor__set_mat_types;
23001 if (PyType_Ready(&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
23002 __pyx_type_15superluWrappers_SparseFactor.tp_print = 0;
23003 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_SparseFactor.tp_dictoffset && __pyx_type_15superluWrappers_SparseFactor.tp_getattro == PyObject_GenericGetAttr)) {
23004 __pyx_type_15superluWrappers_SparseFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23006 #if CYTHON_COMPILING_IN_CPYTHON
23008 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_15superluWrappers_SparseFactor,
"__init__");
if (unlikely(!wrapper)) __PYX_ERR(0, 145, __pyx_L1_error)
23009 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
23010 __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
23011 __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__.doc = __pyx_doc_15superluWrappers_12SparseFactor___init__;
23012 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
23016 if (__Pyx_SetVtable(__pyx_type_15superluWrappers_SparseFactor.tp_dict, __pyx_vtabptr_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
23017 if (PyObject_SetAttrString(__pyx_m,
"SparseFactor", (PyObject *)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
23018 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
23019 __pyx_ptype_15superluWrappers_SparseFactor = &__pyx_type_15superluWrappers_SparseFactor;
23020 __pyx_vtabptr_array = &__pyx_vtable_array;
23021 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
23022 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23023 __pyx_type___pyx_array.tp_print = 0;
23024 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23025 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23026 __pyx_array_type = &__pyx_type___pyx_array;
23027 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23028 __pyx_type___pyx_MemviewEnum.tp_print = 0;
23029 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23030 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23032 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23033 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23034 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23035 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23036 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23037 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23038 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23039 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23040 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
23041 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23042 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23043 __pyx_type___pyx_memoryview.tp_print = 0;
23044 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23045 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23047 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23048 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23049 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23050 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23051 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23052 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
23053 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23054 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23055 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23056 __pyx_type___pyx_memoryviewslice.tp_print = 0;
23057 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23058 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23060 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23061 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23062 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23063 __Pyx_RefNannyFinishContext();
23066 __Pyx_RefNannyFinishContext();
23070 static int __Pyx_modinit_type_import_code(
void) {
23071 __Pyx_RefNannyDeclarations
23072 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
23074 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME,
"type",
23075 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23076 sizeof(PyTypeObject),
23078 sizeof(PyHeapTypeObject),
23080 0);
if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
23081 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(
"numpy",
"dtype",
sizeof(PyArray_Descr), 0);
if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(2, 164, __pyx_L1_error)
23082 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(
"numpy",
"flatiter",
sizeof(PyArrayIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 186, __pyx_L1_error)
23083 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 190, __pyx_L1_error)
23084 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(
"numpy",
"ndarray",
sizeof(PyArrayObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 199, __pyx_L1_error)
23085 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(
"numpy",
"ufunc",
sizeof(PyUFuncObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 872, __pyx_L1_error)
23086 __Pyx_RefNannyFinishContext();
23089 __Pyx_RefNannyFinishContext();
23093 static int __Pyx_modinit_variable_import_code(
void) {
23094 __Pyx_RefNannyDeclarations
23095 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
23097 __Pyx_RefNannyFinishContext();
23101 static int __Pyx_modinit_function_import_code(
void) {
23102 __Pyx_RefNannyDeclarations
23103 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
23105 __Pyx_RefNannyFinishContext();
23110 #if PY_MAJOR_VERSION < 3
23111 #ifdef CYTHON_NO_PYINIT_EXPORT
23112 #define __Pyx_PyMODINIT_FUNC void
23114 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23117 #ifdef CYTHON_NO_PYINIT_EXPORT
23118 #define __Pyx_PyMODINIT_FUNC PyObject *
23120 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23123 #ifndef CYTHON_SMALL_CODE
23124 #if defined(__clang__)
23125 #define CYTHON_SMALL_CODE
23126 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
23127 #define CYTHON_SMALL_CODE __attribute__((cold))
23129 #define CYTHON_SMALL_CODE
23134 #if PY_MAJOR_VERSION < 3
23135 __Pyx_PyMODINIT_FUNC initsuperluWrappers(
void) CYTHON_SMALL_CODE;
23136 __Pyx_PyMODINIT_FUNC initsuperluWrappers(
void)
23138 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(
void) CYTHON_SMALL_CODE;
23139 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(
void)
23140 #if CYTHON_PEP489_MULTI_PHASE_INIT
23142 return PyModuleDef_Init(&__pyx_moduledef);
23144 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name) {
23145 PyObject *value = PyObject_GetAttrString(spec, from_name);
23147 if (likely(value)) {
23148 result = PyDict_SetItemString(moddict, to_name, value);
23150 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23157 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23158 PyObject *module = NULL, *moddict, *modname;
23160 return __Pyx_NewRef(__pyx_m);
23161 modname = PyObject_GetAttrString(spec,
"name");
23162 if (unlikely(!modname))
goto bad;
23163 module = PyModule_NewObject(modname);
23164 Py_DECREF(modname);
23165 if (unlikely(!module))
goto bad;
23166 moddict = PyModule_GetDict(module);
23167 if (unlikely(!moddict))
goto bad;
23168 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__") < 0))
goto bad;
23169 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__") < 0))
goto bad;
23170 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__") < 0))
goto bad;
23171 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__") < 0))
goto bad;
23174 Py_XDECREF(module);
23179 static int __pyx_pymod_exec_superluWrappers(PyObject *__pyx_pyinit_module)
23183 PyObject *__pyx_t_1 = NULL;
23184 PyObject *__pyx_t_2 = NULL;
23185 PyObject *__pyx_t_3 = NULL;
23186 static PyThread_type_lock __pyx_t_4[8];
23187 __Pyx_RefNannyDeclarations
23188 #if CYTHON_PEP489_MULTI_PHASE_INIT
23189 if (__pyx_m && __pyx_m == __pyx_pyinit_module)
return 0;
23190 #elif PY_MAJOR_VERSION >= 3
23191 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
23193 #if CYTHON_REFNANNY
23194 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
23195 if (!__Pyx_RefNanny) {
23197 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
23198 if (!__Pyx_RefNanny)
23199 Py_FatalError(
"failed to import 'refnanny' module");
23202 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)", 0);
23203 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23204 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23205 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23206 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23207 #ifdef __Pyx_CyFunction_USED
23208 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23210 #ifdef __Pyx_FusedFunction_USED
23211 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23213 #ifdef __Pyx_Coroutine_USED
23214 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23216 #ifdef __Pyx_Generator_USED
23217 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23219 #ifdef __Pyx_AsyncGen_USED
23220 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23222 #ifdef __Pyx_StopAsyncIteration_USED
23223 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23227 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23229 PyEval_InitThreads();
23233 #if CYTHON_PEP489_MULTI_PHASE_INIT
23234 __pyx_m = __pyx_pyinit_module;
23235 Py_INCREF(__pyx_m);
23237 #if PY_MAJOR_VERSION < 3
23238 __pyx_m = Py_InitModule4(
"superluWrappers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23240 __pyx_m = PyModule_Create(&__pyx_moduledef);
23242 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23244 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23245 Py_INCREF(__pyx_d);
23246 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23247 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23248 #if CYTHON_COMPILING_IN_PYPY
23249 Py_INCREF(__pyx_b);
23251 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23253 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23254 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23255 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23257 if (__pyx_module_is_main_superluWrappers) {
23258 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23260 #if PY_MAJOR_VERSION >= 3
23262 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23263 if (!PyDict_GetItemString(modules,
"superluWrappers")) {
23264 if (unlikely(PyDict_SetItemString(modules,
"superluWrappers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23269 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23271 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23273 (void)__Pyx_modinit_global_init_code();
23274 (void)__Pyx_modinit_variable_export_code();
23275 (void)__Pyx_modinit_function_export_code();
23276 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
23277 if (unlikely(__Pyx_modinit_type_import_code() != 0))
goto __pyx_L1_error;
23278 (void)__Pyx_modinit_variable_import_code();
23279 (void)__Pyx_modinit_function_import_code();
23281 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23282 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23292 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
23293 __Pyx_GOTREF(__pyx_t_1);
23294 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
23295 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23304 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__36);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
23305 __Pyx_GOTREF(__pyx_t_1);
23306 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__36, __pyx_n_s_SparseMatrix, __pyx_n_s_SparseMatrix, (PyObject *) NULL, __pyx_n_s_superluWrappers, (PyObject *) NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
23307 __Pyx_GOTREF(__pyx_t_2);
23316 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_1__init__, 0, __pyx_n_s_SparseMatrix___init, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__38));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
23317 __Pyx_GOTREF(__pyx_t_3);
23318 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
23319 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23328 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_3matvec, 0, __pyx_n_s_SparseMatrix_matvec, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__40));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
23329 __Pyx_GOTREF(__pyx_t_3);
23330 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_matvec, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
23331 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23340 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite, 0, __pyx_n_s_SparseMatrix_fwrite, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__42));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error)
23341 __Pyx_GOTREF(__pyx_t_3);
23342 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_fwrite, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
23343 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23352 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getCSRrepresentatio, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__44));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
23353 __Pyx_GOTREF(__pyx_t_3);
23354 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
23355 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23364 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getSubMatCSRreprese, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__46));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
23365 __Pyx_GOTREF(__pyx_t_3);
23366 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSubMatCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
23367 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23376 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SparseMatrix, __pyx_tuple__36, __pyx_t_2, NULL, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error)
23377 __Pyx_GOTREF(__pyx_t_3);
23378 if (PyDict_SetItem(__pyx_d, __pyx_n_s_SparseMatrix, __pyx_t_3) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
23379 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23380 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23381 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23390 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_1sparseFactorPrepare, NULL, __pyx_n_s_superluWrappers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
23391 __Pyx_GOTREF(__pyx_t_1);
23392 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorPrepare, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
23393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23402 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_3sparseFactorSolve, NULL, __pyx_n_s_superluWrappers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
23403 __Pyx_GOTREF(__pyx_t_1);
23404 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorSolve, __pyx_t_1) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
23405 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23412 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23413 __Pyx_GOTREF(__pyx_t_1);
23414 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23415 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23424 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 208, __pyx_L1_error)
23425 __Pyx_GOTREF(__pyx_t_1);
23426 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 208, __pyx_L1_error)
23427 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23428 PyType_Modified(__pyx_array_type);
23437 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 285, __pyx_L1_error)
23438 __Pyx_GOTREF(__pyx_t_1);
23439 __Pyx_XGOTREF(
generic);
23440 __Pyx_DECREF_SET(
generic, __pyx_t_1);
23441 __Pyx_GIVEREF(__pyx_t_1);
23451 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23452 __Pyx_GOTREF(__pyx_t_1);
23453 __Pyx_XGOTREF(strided);
23454 __Pyx_DECREF_SET(strided, __pyx_t_1);
23455 __Pyx_GIVEREF(__pyx_t_1);
23465 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23466 __Pyx_GOTREF(__pyx_t_1);
23467 __Pyx_XGOTREF(indirect);
23468 __Pyx_DECREF_SET(indirect, __pyx_t_1);
23469 __Pyx_GIVEREF(__pyx_t_1);
23479 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
23480 __Pyx_GOTREF(__pyx_t_1);
23481 __Pyx_XGOTREF(contiguous);
23482 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23483 __Pyx_GIVEREF(__pyx_t_1);
23493 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23494 __Pyx_GOTREF(__pyx_t_1);
23495 __Pyx_XGOTREF(indirect_contiguous);
23496 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23497 __Pyx_GIVEREF(__pyx_t_1);
23507 __pyx_memoryview_thread_locks_used = 0;
23516 __pyx_t_4[0] = PyThread_allocate_lock();
23517 __pyx_t_4[1] = PyThread_allocate_lock();
23518 __pyx_t_4[2] = PyThread_allocate_lock();
23519 __pyx_t_4[3] = PyThread_allocate_lock();
23520 __pyx_t_4[4] = PyThread_allocate_lock();
23521 __pyx_t_4[5] = PyThread_allocate_lock();
23522 __pyx_t_4[6] = PyThread_allocate_lock();
23523 __pyx_t_4[7] = PyThread_allocate_lock();
23524 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23533 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 544, __pyx_L1_error)
23534 __Pyx_GOTREF(__pyx_t_1);
23535 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 544, __pyx_L1_error)
23536 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23537 PyType_Modified(__pyx_memoryview_type);
23546 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 990, __pyx_L1_error)
23547 __Pyx_GOTREF(__pyx_t_1);
23548 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 990, __pyx_L1_error)
23549 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23550 PyType_Modified(__pyx_memoryviewslice_type);
23557 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23558 __Pyx_GOTREF(__pyx_t_1);
23559 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23560 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23574 __Pyx_XDECREF(__pyx_t_1);
23575 __Pyx_XDECREF(__pyx_t_2);
23576 __Pyx_XDECREF(__pyx_t_3);
23579 __Pyx_AddTraceback(
"init superluWrappers", 0, __pyx_lineno, __pyx_filename);
23581 Py_DECREF(__pyx_m); __pyx_m = 0;
23582 }
else if (!PyErr_Occurred()) {
23583 PyErr_SetString(PyExc_ImportError,
"init superluWrappers");
23586 __Pyx_RefNannyFinishContext();
23587 #if CYTHON_PEP489_MULTI_PHASE_INIT
23588 return (__pyx_m != NULL) ? 0 : -1;
23589 #elif PY_MAJOR_VERSION >= 3
23598 #if CYTHON_REFNANNY
23599 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23600 PyObject *m = NULL, *p = NULL;
23602 m = PyImport_ImportModule((
char *)modname);
23604 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
23606 r = PyLong_AsVoidPtr(p);
23610 return (__Pyx_RefNannyAPIStruct *)
r;
23615 #if CYTHON_USE_TYPE_SLOTS
23616 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23617 PyTypeObject* tp = Py_TYPE(obj);
23618 if (likely(tp->tp_getattro))
23619 return tp->tp_getattro(obj, attr_name);
23620 #if PY_MAJOR_VERSION < 3
23621 if (likely(tp->tp_getattr))
23622 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23624 return PyObject_GetAttr(obj, attr_name);
23629 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23630 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23631 if (unlikely(!result)) {
23632 PyErr_Format(PyExc_NameError,
23633 #
if PY_MAJOR_VERSION >= 3
23634 "name '%U' is not defined", name);
23636 "name '%.200s' is not defined", PyString_AS_STRING(name));
23643 static void __Pyx_RaiseArgtupleInvalid(
23644 const char* func_name,
23646 Py_ssize_t num_min,
23647 Py_ssize_t num_max,
23648 Py_ssize_t num_found)
23650 Py_ssize_t num_expected;
23651 const char *more_or_less;
23652 if (num_found < num_min) {
23653 num_expected = num_min;
23654 more_or_less =
"at least";
23656 num_expected = num_max;
23657 more_or_less =
"at most";
23660 more_or_less =
"exactly";
23662 PyErr_Format(PyExc_TypeError,
23663 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
23664 func_name, more_or_less, num_expected,
23665 (num_expected == 1) ?
"" :
"s", num_found);
23669 static void __Pyx_RaiseDoubleKeywordsError(
23670 const char* func_name,
23673 PyErr_Format(PyExc_TypeError,
23674 #
if PY_MAJOR_VERSION >= 3
23675 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23677 "%s() got multiple values for keyword argument '%s'", func_name,
23678 PyString_AsString(kw_name));
23683 static int __Pyx_ParseOptionalKeywords(
23685 PyObject **argnames[],
23687 PyObject *values[],
23688 Py_ssize_t num_pos_args,
23689 const char* function_name)
23691 PyObject *key = 0, *value = 0;
23692 Py_ssize_t
pos = 0;
23694 PyObject*** first_kw_arg = argnames + num_pos_args;
23695 while (PyDict_Next(kwds, &
pos, &key, &value)) {
23696 name = first_kw_arg;
23697 while (*name && (**name != key)) name++;
23699 values[name-argnames] = value;
23702 name = first_kw_arg;
23703 #if PY_MAJOR_VERSION < 3
23704 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
23706 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23707 && _PyString_Eq(**name, key)) {
23708 values[name-argnames] = value;
23713 if (*name)
continue;
23715 PyObject*** argname = argnames;
23716 while (argname != first_kw_arg) {
23717 if ((**argname == key) || (
23718 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23719 && _PyString_Eq(**argname, key))) {
23720 goto arg_passed_twice;
23727 if (likely(PyUnicode_Check(key))) {
23729 int cmp = (**name == key) ? 0 :
23730 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23731 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
23733 PyUnicode_Compare(**name, key);
23734 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23736 values[name-argnames] = value;
23741 if (*name)
continue;
23743 PyObject*** argname = argnames;
23744 while (argname != first_kw_arg) {
23745 int cmp = (**argname == key) ? 0 :
23746 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23747 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
23749 PyUnicode_Compare(**argname, key);
23750 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23751 if (cmp == 0)
goto arg_passed_twice;
23756 goto invalid_keyword_type;
23758 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
23760 goto invalid_keyword;
23765 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23767 invalid_keyword_type:
23768 PyErr_Format(PyExc_TypeError,
23769 "%.200s() keywords must be strings", function_name);
23772 PyErr_Format(PyExc_TypeError,
23773 #
if PY_MAJOR_VERSION < 3
23774 "%.200s() got an unexpected keyword argument '%.200s'",
23775 function_name, PyString_AsString(key));
23777 "%s() got an unexpected keyword argument '%U'",
23778 function_name, key);
23785 #if CYTHON_USE_TYPE_SLOTS
23786 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
23787 PyTypeObject* tp = Py_TYPE(obj);
23788 if (likely(tp->tp_setattro))
23789 return tp->tp_setattro(obj, attr_name, value);
23790 #if PY_MAJOR_VERSION < 3
23791 if (likely(tp->tp_setattr))
23792 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
23794 return PyObject_SetAttr(obj, attr_name, value);
23799 #if CYTHON_COMPILING_IN_CPYTHON
23800 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23802 ternaryfunc call = func->ob_type->tp_call;
23803 if (unlikely(!call))
23804 return PyObject_Call(func, arg, kw);
23805 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
23807 result = (*call)(func, arg, kw);
23808 Py_LeaveRecursiveCall();
23809 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23812 "NULL result without error in PyObject_Call");
23819 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
23820 if (unlikely(!type)) {
23821 PyErr_SetString(PyExc_SystemError,
"Missing type object");
23824 if (likely(__Pyx_TypeCheck(obj, type)))
23826 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
23827 Py_TYPE(obj)->tp_name, type->tp_name);
23833 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
23835 __Pyx_memviewslice *memviewslice,
23836 int memview_is_new_reference)
23838 __Pyx_RefNannyDeclarations
23840 Py_buffer *buf = &memview->view;
23841 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
23843 PyErr_SetString(PyExc_ValueError,
23846 }
else if (memviewslice->memview || memviewslice->data) {
23847 PyErr_SetString(PyExc_ValueError,
23848 "memviewslice is already initialized!");
23851 if (buf->strides) {
23852 for (i = 0; i < ndim; i++) {
23853 memviewslice->strides[i] = buf->strides[i];
23856 Py_ssize_t stride = buf->itemsize;
23857 for (i = ndim - 1; i >= 0; i--) {
23858 memviewslice->strides[i] = stride;
23859 stride *= buf->shape[i];
23862 for (i = 0; i < ndim; i++) {
23863 memviewslice->shape[i] = buf->shape[i];
23864 if (buf->suboffsets) {
23865 memviewslice->suboffsets[i] = buf->suboffsets[i];
23867 memviewslice->suboffsets[i] = -1;
23870 memviewslice->memview = memview;
23871 memviewslice->data = (
char *)buf->buf;
23872 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
23873 Py_INCREF(memview);
23878 memviewslice->memview = 0;
23879 memviewslice->data = 0;
23882 __Pyx_RefNannyFinishContext();
23885 #ifndef Py_NO_RETURN
23886 #define Py_NO_RETURN
23888 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
23891 #ifdef HAVE_STDARG_PROTOTYPES
23892 va_start(vargs, fmt);
23896 vsnprintf(msg, 200, fmt, vargs);
23898 Py_FatalError(msg);
23900 static CYTHON_INLINE
int
23901 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23902 PyThread_type_lock lock)
23905 PyThread_acquire_lock(lock, 1);
23906 result = (*acquisition_count)++;
23907 PyThread_release_lock(lock);
23910 static CYTHON_INLINE
int
23911 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23912 PyThread_type_lock lock)
23915 PyThread_acquire_lock(lock, 1);
23916 result = (*acquisition_count)--;
23917 PyThread_release_lock(lock);
23920 static CYTHON_INLINE
void
23921 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
23924 struct __pyx_memoryview_obj *memview = memslice->memview;
23925 if (!memview || (PyObject *) memview == Py_None)
23927 if (__pyx_get_slice_count(memview) < 0)
23928 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
23929 __pyx_get_slice_count(memview), lineno);
23930 first_time = __pyx_add_acquisition_count(memview) == 0;
23933 Py_INCREF((PyObject *) memview);
23935 PyGILState_STATE _gilstate = PyGILState_Ensure();
23936 Py_INCREF((PyObject *) memview);
23937 PyGILState_Release(_gilstate);
23941 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
23942 int have_gil,
int lineno) {
23944 struct __pyx_memoryview_obj *memview = memslice->memview;
23947 }
else if ((PyObject *) memview == Py_None) {
23948 memslice->memview = NULL;
23951 if (__pyx_get_slice_count(memview) <= 0)
23952 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
23953 __pyx_get_slice_count(memview), lineno);
23954 last_time = __pyx_sub_acquisition_count(memview) == 1;
23955 memslice->data = NULL;
23958 Py_CLEAR(memslice->memview);
23960 PyGILState_STATE _gilstate = PyGILState_Ensure();
23961 Py_CLEAR(memslice->memview);
23962 PyGILState_Release(_gilstate);
23965 memslice->memview = NULL;
23970 #if CYTHON_FAST_PYCCALL
23971 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23972 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23973 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23974 PyObject *
self = PyCFunction_GET_SELF(func);
23975 int flags = PyCFunction_GET_FLAGS(func);
23976 assert(PyCFunction_Check(func));
23977 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
23978 assert(nargs >= 0);
23979 assert(nargs == 0 || args != NULL);
23983 assert(!PyErr_Occurred());
23984 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23985 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (
self, args, nargs, NULL);
23987 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args, nargs);
23993 #if CYTHON_FAST_PYCALL
23994 #include "frameobject.h"
23995 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23996 PyObject *globals) {
23998 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23999 PyObject **fastlocals;
24002 assert(globals != NULL);
24007 assert(tstate != NULL);
24008 f = PyFrame_New(tstate, co, globals, NULL);
24012 fastlocals =
f->f_localsplus;
24013 for (i = 0; i < na; i++) {
24015 fastlocals[i] = *args++;
24017 result = PyEval_EvalFrameEx(
f,0);
24018 ++tstate->recursion_depth;
24020 --tstate->recursion_depth;
24023 #if 1 || PY_VERSION_HEX < 0x030600B1
24024 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
24025 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24026 PyObject *globals = PyFunction_GET_GLOBALS(func);
24027 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24029 #if PY_MAJOR_VERSION >= 3
24032 PyObject *kwtuple, **k;
24037 assert(kwargs == NULL || PyDict_Check(kwargs));
24038 nk = kwargs ? PyDict_Size(kwargs) : 0;
24039 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24043 #
if PY_MAJOR_VERSION >= 3
24044 co->co_kwonlyargcount == 0 &&
24046 likely(kwargs == NULL || nk == 0) &&
24047 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24048 if (argdefs == NULL && co->co_argcount == nargs) {
24049 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24052 else if (nargs == 0 && argdefs != NULL
24053 && co->co_argcount == Py_SIZE(argdefs)) {
24056 args = &PyTuple_GET_ITEM(argdefs, 0);
24057 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24061 if (kwargs != NULL) {
24063 kwtuple = PyTuple_New(2 * nk);
24064 if (kwtuple == NULL) {
24068 k = &PyTuple_GET_ITEM(kwtuple, 0);
24070 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
24081 closure = PyFunction_GET_CLOSURE(func);
24082 #if PY_MAJOR_VERSION >= 3
24083 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24085 if (argdefs != NULL) {
24086 d = &PyTuple_GET_ITEM(argdefs, 0);
24087 nd = Py_SIZE(argdefs);
24093 #if PY_MAJOR_VERSION >= 3
24094 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24097 d, (
int)nd, kwdefs, closure);
24099 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24102 d, (
int)nd, closure);
24104 Py_XDECREF(kwtuple);
24106 Py_LeaveRecursiveCall();
24113 #if CYTHON_COMPILING_IN_CPYTHON
24114 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24115 PyObject *
self, *result;
24117 cfunc = PyCFunction_GET_FUNCTION(func);
24118 self = PyCFunction_GET_SELF(func);
24119 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24121 result = cfunc(
self, arg);
24122 Py_LeaveRecursiveCall();
24123 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24126 "NULL result without error in PyObject_Call");
24133 #if CYTHON_COMPILING_IN_CPYTHON
24134 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24136 PyObject *args = PyTuple_New(1);
24137 if (unlikely(!args))
return NULL;
24139 PyTuple_SET_ITEM(args, 0, arg);
24140 result = __Pyx_PyObject_Call(func, args, NULL);
24144 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24145 #if CYTHON_FAST_PYCALL
24146 if (PyFunction_Check(func)) {
24147 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24150 if (likely(PyCFunction_Check(func))) {
24151 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24152 return __Pyx_PyObject_CallMethO(func, arg);
24153 #if CYTHON_FAST_PYCCALL
24154 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24155 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24159 return __Pyx__PyObject_CallOneArg(func, arg);
24162 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24164 PyObject *args = PyTuple_Pack(1, arg);
24165 if (unlikely(!args))
return NULL;
24166 result = __Pyx_PyObject_Call(func, args, NULL);
24173 #if CYTHON_COMPILING_IN_CPYTHON
24174 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24175 #if CYTHON_FAST_PYCALL
24176 if (PyFunction_Check(func)) {
24177 return __Pyx_PyFunction_FastCall(func, NULL, 0);
24180 #ifdef __Pyx_CyFunction_USED
24181 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
24183 if (likely(PyCFunction_Check(func))) {
24185 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24186 return __Pyx_PyObject_CallMethO(func, NULL);
24189 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24194 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24196 if (!j)
return NULL;
24197 r = PyObject_GetItem(o, j);
24201 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24202 CYTHON_NCP_UNUSED
int wraparound,
24203 CYTHON_NCP_UNUSED
int boundscheck) {
24204 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24205 Py_ssize_t wrapped_i = i;
24206 if (wraparound & unlikely(i < 0)) {
24207 wrapped_i += PyList_GET_SIZE(o);
24209 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
24210 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
24214 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24216 return PySequence_GetItem(o, i);
24219 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24220 CYTHON_NCP_UNUSED
int wraparound,
24221 CYTHON_NCP_UNUSED
int boundscheck) {
24222 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24223 Py_ssize_t wrapped_i = i;
24224 if (wraparound & unlikely(i < 0)) {
24225 wrapped_i += PyTuple_GET_SIZE(o);
24227 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
24228 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
24232 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24234 return PySequence_GetItem(o, i);
24237 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24238 CYTHON_NCP_UNUSED
int wraparound,
24239 CYTHON_NCP_UNUSED
int boundscheck) {
24240 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24241 if (is_list || PyList_CheckExact(o)) {
24242 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24243 if ((!boundscheck) || (likely((
n >= 0) & (
n < PyList_GET_SIZE(o))))) {
24244 PyObject *
r = PyList_GET_ITEM(o,
n);
24249 else if (PyTuple_CheckExact(o)) {
24250 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24251 if ((!boundscheck) || likely((
n >= 0) & (
n < PyTuple_GET_SIZE(o)))) {
24252 PyObject *
r = PyTuple_GET_ITEM(o,
n);
24257 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24258 if (likely(m && m->sq_item)) {
24259 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24260 Py_ssize_t l = m->sq_length(o);
24261 if (likely(l >= 0)) {
24264 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24269 return m->sq_item(o, i);
24273 if (is_list || PySequence_Check(o)) {
24274 return PySequence_GetItem(o, i);
24277 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24281 #if CYTHON_USE_TYPE_SLOTS
24282 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24284 Py_ssize_t key_value;
24285 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24286 if (unlikely(!(m && m->sq_item))) {
24287 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24290 key_value = __Pyx_PyIndex_AsSsize_t(index);
24291 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24292 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24294 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24296 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24300 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24301 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24302 if (likely(m && m->mp_subscript)) {
24303 return m->mp_subscript(obj, key);
24305 return __Pyx_PyObject_GetIndex(obj, key);
24310 #if !CYTHON_COMPILING_IN_PYPY
24311 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
24312 #if PY_MAJOR_VERSION < 3
24313 if (likely(PyInt_CheckExact(op1))) {
24314 const long b = intval;
24316 long a = PyInt_AS_LONG(op1);
24317 x = (long)((
unsigned long)a + b);
24318 if (likely((x^a) >= 0 || (x^b) >= 0))
24319 return PyInt_FromLong(x);
24320 return PyLong_Type.tp_as_number->nb_add(op1, op2);
24323 #if CYTHON_USE_PYLONG_INTERNALS
24324 if (likely(PyLong_CheckExact(op1))) {
24325 const long b = intval;
24327 #ifdef HAVE_LONG_LONG
24328 const PY_LONG_LONG llb = intval;
24329 PY_LONG_LONG lla, llx;
24331 const digit* digits = ((PyLongObject*)op1)->ob_digit;
24332 const Py_ssize_t size = Py_SIZE(op1);
24333 if (likely(__Pyx_sst_abs(size) <= 1)) {
24334 a = likely(size) ? digits[0] : 0;
24335 if (size == -1) a = -a;
24339 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24340 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24342 #ifdef HAVE_LONG_LONG
24343 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24344 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24348 CYTHON_FALLTHROUGH;
24350 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24351 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24353 #ifdef HAVE_LONG_LONG
24354 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24355 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24359 CYTHON_FALLTHROUGH;
24361 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24362 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24364 #ifdef HAVE_LONG_LONG
24365 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24366 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24370 CYTHON_FALLTHROUGH;
24372 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24373 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24375 #ifdef HAVE_LONG_LONG
24376 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24377 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24381 CYTHON_FALLTHROUGH;
24383 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24384 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24386 #ifdef HAVE_LONG_LONG
24387 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24388 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24392 CYTHON_FALLTHROUGH;
24394 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24395 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24397 #ifdef HAVE_LONG_LONG
24398 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24399 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24403 CYTHON_FALLTHROUGH;
24404 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
24408 return PyLong_FromLong(x);
24409 #ifdef HAVE_LONG_LONG
24412 return PyLong_FromLongLong(llx);
24418 if (PyFloat_CheckExact(op1)) {
24419 const long b = intval;
24420 double a = PyFloat_AS_DOUBLE(op1);
24422 PyFPE_START_PROTECT(
"add",
return NULL)
24423 result = ((double)a) + (double)b;
24424 PyFPE_END_PROTECT(result)
24425 return PyFloat_FromDouble(result);
24427 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24432 #if CYTHON_FAST_THREAD_STATE
24433 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24434 #if PY_VERSION_HEX >= 0x030700A3
24435 *type = tstate->exc_state.exc_type;
24436 *value = tstate->exc_state.exc_value;
24437 *tb = tstate->exc_state.exc_traceback;
24439 *type = tstate->exc_type;
24440 *value = tstate->exc_value;
24441 *tb = tstate->exc_traceback;
24444 Py_XINCREF(*value);
24447 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24448 PyObject *tmp_type, *tmp_value, *tmp_tb;
24449 #if PY_VERSION_HEX >= 0x030700A3
24450 tmp_type = tstate->exc_state.exc_type;
24451 tmp_value = tstate->exc_state.exc_value;
24452 tmp_tb = tstate->exc_state.exc_traceback;
24453 tstate->exc_state.exc_type = type;
24454 tstate->exc_state.exc_value = value;
24455 tstate->exc_state.exc_traceback = tb;
24457 tmp_type = tstate->exc_type;
24458 tmp_value = tstate->exc_value;
24459 tmp_tb = tstate->exc_traceback;
24460 tstate->exc_type = type;
24461 tstate->exc_value = value;
24462 tstate->exc_traceback = tb;
24464 Py_XDECREF(tmp_type);
24465 Py_XDECREF(tmp_value);
24466 Py_XDECREF(tmp_tb);
24471 #if CYTHON_FAST_THREAD_STATE
24472 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24474 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
24476 PyObject *local_type, *local_value, *local_tb;
24477 #if CYTHON_FAST_THREAD_STATE
24478 PyObject *tmp_type, *tmp_value, *tmp_tb;
24479 local_type = tstate->curexc_type;
24480 local_value = tstate->curexc_value;
24481 local_tb = tstate->curexc_traceback;
24482 tstate->curexc_type = 0;
24483 tstate->curexc_value = 0;
24484 tstate->curexc_traceback = 0;
24486 PyErr_Fetch(&local_type, &local_value, &local_tb);
24488 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24489 #if CYTHON_FAST_THREAD_STATE
24490 if (unlikely(tstate->curexc_type))
24492 if (unlikely(PyErr_Occurred()))
24495 #if PY_MAJOR_VERSION >= 3
24497 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24501 Py_XINCREF(local_tb);
24502 Py_XINCREF(local_type);
24503 Py_XINCREF(local_value);
24504 *type = local_type;
24505 *value = local_value;
24507 #if CYTHON_FAST_THREAD_STATE
24508 #if PY_VERSION_HEX >= 0x030700A3
24509 tmp_type = tstate->exc_state.exc_type;
24510 tmp_value = tstate->exc_state.exc_value;
24511 tmp_tb = tstate->exc_state.exc_traceback;
24512 tstate->exc_state.exc_type = local_type;
24513 tstate->exc_state.exc_value = local_value;
24514 tstate->exc_state.exc_traceback = local_tb;
24516 tmp_type = tstate->exc_type;
24517 tmp_value = tstate->exc_value;
24518 tmp_tb = tstate->exc_traceback;
24519 tstate->exc_type = local_type;
24520 tstate->exc_value = local_value;
24521 tstate->exc_traceback = local_tb;
24523 Py_XDECREF(tmp_type);
24524 Py_XDECREF(tmp_value);
24525 Py_XDECREF(tmp_tb);
24527 PyErr_SetExcInfo(local_type, local_value, local_tb);
24534 Py_XDECREF(local_type);
24535 Py_XDECREF(local_value);
24536 Py_XDECREF(local_tb);
24541 #if CYTHON_FAST_THREAD_STATE
24542 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24543 PyObject *tmp_type, *tmp_value, *tmp_tb;
24544 tmp_type = tstate->curexc_type;
24545 tmp_value = tstate->curexc_value;
24546 tmp_tb = tstate->curexc_traceback;
24547 tstate->curexc_type = type;
24548 tstate->curexc_value = value;
24549 tstate->curexc_traceback = tb;
24550 Py_XDECREF(tmp_type);
24551 Py_XDECREF(tmp_value);
24552 Py_XDECREF(tmp_tb);
24554 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24555 *type = tstate->curexc_type;
24556 *value = tstate->curexc_value;
24557 *tb = tstate->curexc_traceback;
24558 tstate->curexc_type = 0;
24559 tstate->curexc_value = 0;
24560 tstate->curexc_traceback = 0;
24565 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
24566 Py_ssize_t cstart, Py_ssize_t cstop,
24567 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
24568 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
24569 #if CYTHON_USE_TYPE_SLOTS
24570 PyMappingMethods* mp;
24571 #if PY_MAJOR_VERSION < 3
24572 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
24573 if (likely(ms && ms->sq_slice)) {
24575 if (_py_start && (*_py_start != Py_None)) {
24576 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
24577 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
24582 if (_py_stop && (*_py_stop != Py_None)) {
24583 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
24584 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
24586 cstop = PY_SSIZE_T_MAX;
24588 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
24589 Py_ssize_t l = ms->sq_length(obj);
24590 if (likely(l >= 0)) {
24593 if (cstop < 0) cstop = 0;
24597 if (cstart < 0) cstart = 0;
24600 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24605 return ms->sq_slice(obj, cstart, cstop);
24608 mp = Py_TYPE(obj)->tp_as_mapping;
24609 if (likely(mp && mp->mp_subscript))
24613 PyObject *py_slice, *py_start, *py_stop;
24615 py_slice = *_py_slice;
24617 PyObject* owned_start = NULL;
24618 PyObject* owned_stop = NULL;
24620 py_start = *_py_start;
24623 owned_start = py_start = PyInt_FromSsize_t(cstart);
24624 if (unlikely(!py_start))
goto bad;
24626 py_start = Py_None;
24629 py_stop = *_py_stop;
24632 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
24633 if (unlikely(!py_stop)) {
24634 Py_XDECREF(owned_start);
24640 py_slice = PySlice_New(py_start, py_stop, Py_None);
24641 Py_XDECREF(owned_start);
24642 Py_XDECREF(owned_stop);
24643 if (unlikely(!py_slice))
goto bad;
24645 #if CYTHON_USE_TYPE_SLOTS
24646 result = mp->mp_subscript(obj, py_slice);
24648 result = PyObject_GetItem(obj, py_slice);
24651 Py_DECREF(py_slice);
24655 PyErr_Format(PyExc_TypeError,
24656 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
24662 #if PY_MAJOR_VERSION < 3
24663 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24664 CYTHON_UNUSED PyObject *cause) {
24665 __Pyx_PyThreadState_declare
24667 if (!value || value == Py_None)
24671 if (!tb || tb == Py_None)
24675 if (!PyTraceBack_Check(tb)) {
24676 PyErr_SetString(PyExc_TypeError,
24677 "raise: arg 3 must be a traceback or None");
24681 if (PyType_Check(type)) {
24682 #if CYTHON_COMPILING_IN_PYPY
24684 Py_INCREF(Py_None);
24688 PyErr_NormalizeException(&type, &value, &tb);
24691 PyErr_SetString(PyExc_TypeError,
24692 "instance exception may not have a separate value");
24696 type = (PyObject*) Py_TYPE(type);
24698 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24699 PyErr_SetString(PyExc_TypeError,
24700 "raise: exception class must be a subclass of BaseException");
24704 __Pyx_PyThreadState_assign
24705 __Pyx_ErrRestore(type, value, tb);
24714 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24715 PyObject* owned_instance = NULL;
24716 if (tb == Py_None) {
24718 }
else if (tb && !PyTraceBack_Check(tb)) {
24719 PyErr_SetString(PyExc_TypeError,
24720 "raise: arg 3 must be a traceback or None");
24723 if (value == Py_None)
24725 if (PyExceptionInstance_Check(type)) {
24727 PyErr_SetString(PyExc_TypeError,
24728 "instance exception may not have a separate value");
24732 type = (PyObject*) Py_TYPE(value);
24733 }
else if (PyExceptionClass_Check(type)) {
24734 PyObject *instance_class = NULL;
24735 if (value && PyExceptionInstance_Check(value)) {
24736 instance_class = (PyObject*) Py_TYPE(value);
24737 if (instance_class != type) {
24738 int is_subclass = PyObject_IsSubclass(instance_class, type);
24739 if (!is_subclass) {
24740 instance_class = NULL;
24741 }
else if (unlikely(is_subclass == -1)) {
24744 type = instance_class;
24748 if (!instance_class) {
24751 args = PyTuple_New(0);
24752 else if (PyTuple_Check(value)) {
24756 args = PyTuple_Pack(1, value);
24759 owned_instance = PyObject_Call(type, args, NULL);
24761 if (!owned_instance)
24763 value = owned_instance;
24764 if (!PyExceptionInstance_Check(value)) {
24765 PyErr_Format(PyExc_TypeError,
24766 "calling %R should have returned an instance of "
24767 "BaseException, not %R",
24768 type, Py_TYPE(value));
24773 PyErr_SetString(PyExc_TypeError,
24774 "raise: exception class must be a subclass of BaseException");
24778 PyObject *fixed_cause;
24779 if (cause == Py_None) {
24780 fixed_cause = NULL;
24781 }
else if (PyExceptionClass_Check(cause)) {
24782 fixed_cause = PyObject_CallObject(cause, NULL);
24783 if (fixed_cause == NULL)
24785 }
else if (PyExceptionInstance_Check(cause)) {
24786 fixed_cause = cause;
24787 Py_INCREF(fixed_cause);
24789 PyErr_SetString(PyExc_TypeError,
24790 "exception causes must derive from "
24794 PyException_SetCause(value, fixed_cause);
24796 PyErr_SetObject(type, value);
24798 #if CYTHON_COMPILING_IN_PYPY
24799 PyObject *tmp_type, *tmp_value, *tmp_tb;
24800 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24802 PyErr_Restore(tmp_type, tmp_value, tb);
24803 Py_XDECREF(tmp_tb);
24805 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24806 PyObject* tmp_tb = tstate->curexc_traceback;
24807 if (tb != tmp_tb) {
24809 tstate->curexc_traceback = tb;
24810 Py_XDECREF(tmp_tb);
24815 Py_XDECREF(owned_instance);
24821 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
24822 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
24823 int full_traceback, CYTHON_UNUSED
int nogil) {
24824 PyObject *old_exc, *old_val, *old_tb;
24826 __Pyx_PyThreadState_declare
24828 PyGILState_STATE state;
24830 state = PyGILState_Ensure();
24832 else state = (PyGILState_STATE)-1;
24835 __Pyx_PyThreadState_assign
24836 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24837 if (full_traceback) {
24838 Py_XINCREF(old_exc);
24839 Py_XINCREF(old_val);
24840 Py_XINCREF(old_tb);
24841 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24844 #if PY_MAJOR_VERSION < 3
24845 ctx = PyString_FromString(name);
24847 ctx = PyUnicode_FromString(name);
24849 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24851 PyErr_WriteUnraisable(Py_None);
24853 PyErr_WriteUnraisable(ctx);
24858 PyGILState_Release(state);
24863 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24864 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24866 value = PyDict_GetItemWithError(d, key);
24867 if (unlikely(!value)) {
24868 if (!PyErr_Occurred()) {
24869 PyObject* args = PyTuple_Pack(1, key);
24871 PyErr_SetObject(PyExc_KeyError, args);
24882 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24883 PyErr_Format(PyExc_ValueError,
24884 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
24888 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24889 PyErr_Format(PyExc_ValueError,
24890 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
24891 index, (index == 1) ?
"" :
"s");
24895 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
24896 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
24900 #if CYTHON_FAST_THREAD_STATE
24901 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24903 n = PyTuple_GET_SIZE(tuple);
24904 #if PY_MAJOR_VERSION >= 3
24905 for (i=0; i<
n; i++) {
24906 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24909 for (i=0; i<
n; i++) {
24910 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24914 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24915 PyObject *exc_type = tstate->curexc_type;
24916 if (exc_type == err)
return 1;
24917 if (unlikely(!exc_type))
return 0;
24918 if (unlikely(PyTuple_Check(err)))
24919 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24920 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24925 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
24927 if (unlikely(!type)) {
24928 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24932 #if PY_MAJOR_VERSION == 2
24933 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
24937 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
24939 PyErr_Format(PyExc_TypeError,
24940 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24941 name, type->tp_name, Py_TYPE(obj)->tp_name);
24946 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
24947 #if CYTHON_COMPILING_IN_PYPY
24948 return PyObject_RichCompareBool(s1, s2, equals);
24951 return (equals == Py_EQ);
24952 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24953 const char *ps1, *ps2;
24954 Py_ssize_t length = PyBytes_GET_SIZE(s1);
24955 if (length != PyBytes_GET_SIZE(s2))
24956 return (equals == Py_NE);
24957 ps1 = PyBytes_AS_STRING(s1);
24958 ps2 = PyBytes_AS_STRING(s2);
24959 if (ps1[0] != ps2[0]) {
24960 return (equals == Py_NE);
24961 }
else if (length == 1) {
24962 return (equals == Py_EQ);
24965 #if CYTHON_USE_UNICODE_INTERNALS
24966 Py_hash_t hash1, hash2;
24967 hash1 = ((PyBytesObject*)s1)->ob_shash;
24968 hash2 = ((PyBytesObject*)s2)->ob_shash;
24969 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24970 return (equals == Py_NE);
24973 result = memcmp(ps1, ps2, (
size_t)length);
24974 return (equals == Py_EQ) ? (result == 0) : (result != 0);
24976 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24977 return (equals == Py_NE);
24978 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24979 return (equals == Py_NE);
24982 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24985 result = __Pyx_PyObject_IsTrue(py_result);
24986 Py_DECREF(py_result);
24993 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
24994 #if CYTHON_COMPILING_IN_PYPY
24995 return PyObject_RichCompareBool(s1, s2, equals);
24997 #if PY_MAJOR_VERSION < 3
24998 PyObject* owned_ref = NULL;
25000 int s1_is_unicode, s2_is_unicode;
25004 s1_is_unicode = PyUnicode_CheckExact(s1);
25005 s2_is_unicode = PyUnicode_CheckExact(s2);
25006 #if PY_MAJOR_VERSION < 3
25007 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25008 owned_ref = PyUnicode_FromObject(s2);
25009 if (unlikely(!owned_ref))
25013 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25014 owned_ref = PyUnicode_FromObject(s1);
25015 if (unlikely(!owned_ref))
25019 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25020 return __Pyx_PyBytes_Equals(s1, s2, equals);
25023 if (s1_is_unicode & s2_is_unicode) {
25026 void *data1, *data2;
25027 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25029 length = __Pyx_PyUnicode_GET_LENGTH(s1);
25030 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25033 #if CYTHON_USE_UNICODE_INTERNALS
25035 Py_hash_t hash1, hash2;
25036 #if CYTHON_PEP393_ENABLED
25037 hash1 = ((PyASCIIObject*)s1)->hash;
25038 hash2 = ((PyASCIIObject*)s2)->hash;
25040 hash1 = ((PyUnicodeObject*)s1)->hash;
25041 hash2 = ((PyUnicodeObject*)s2)->hash;
25043 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25048 kind = __Pyx_PyUnicode_KIND(s1);
25049 if (kind != __Pyx_PyUnicode_KIND(s2)) {
25052 data1 = __Pyx_PyUnicode_DATA(s1);
25053 data2 = __Pyx_PyUnicode_DATA(s2);
25054 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25056 }
else if (length == 1) {
25059 int result = memcmp(data1, data2, (
size_t)(length * kind));
25060 #if PY_MAJOR_VERSION < 3
25061 Py_XDECREF(owned_ref);
25063 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25065 }
else if ((s1 == Py_None) & s2_is_unicode) {
25067 }
else if ((s2 == Py_None) & s1_is_unicode) {
25071 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25072 #if PY_MAJOR_VERSION < 3
25073 Py_XDECREF(owned_ref);
25077 result = __Pyx_PyObject_IsTrue(py_result);
25078 Py_DECREF(py_result);
25082 #if PY_MAJOR_VERSION < 3
25083 Py_XDECREF(owned_ref);
25085 return (equals == Py_EQ);
25087 #if PY_MAJOR_VERSION < 3
25088 Py_XDECREF(owned_ref);
25090 return (equals == Py_NE);
25095 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25096 Py_ssize_t
q = a / b;
25097 Py_ssize_t
r = a -
q*b;
25098 q -= ((
r != 0) & ((
r ^ b) < 0));
25103 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
25104 #if CYTHON_USE_TYPE_SLOTS
25105 #if PY_MAJOR_VERSION >= 3
25106 if (likely(PyUnicode_Check(
n)))
25108 if (likely(PyString_Check(
n)))
25110 return __Pyx_PyObject_GetAttrStr(o,
n);
25112 return PyObject_GetAttr(o,
n);
25116 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25117 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25118 const char* encoding,
const char* errors,
25119 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
25121 if (unlikely((start < 0) | (stop < 0))) {
25122 size_t slen = strlen(cstring);
25123 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
25124 PyErr_SetString(PyExc_OverflowError,
25125 "c-string too long to convert to Python");
25128 length = (Py_ssize_t) slen;
25137 length = stop - start;
25138 if (unlikely(length <= 0))
25139 return PyUnicode_FromUnicode(NULL, 0);
25142 return decode_func(cstring, length, errors);
25144 return PyUnicode_Decode(cstring, length, encoding, errors);
25149 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25150 __Pyx_PyThreadState_declare
25151 __Pyx_PyThreadState_assign
25152 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25154 __Pyx_PyErr_Clear();
25158 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
25159 PyObject *
r = __Pyx_GetAttr(o,
n);
25160 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
25164 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
25166 #if !CYTHON_AVOID_BORROWED_REFS
25167 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25168 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25169 if (likely(result)) {
25171 }
else if (unlikely(PyErr_Occurred())) {
25175 result = PyDict_GetItem(__pyx_d, name);
25176 if (likely(result)) {
25181 result = PyObject_GetItem(__pyx_d, name);
25185 result = __Pyx_GetBuiltinName(name);
25191 #if CYTHON_FAST_THREAD_STATE
25192 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25193 PyObject *tmp_type, *tmp_value, *tmp_tb;
25194 #if PY_VERSION_HEX >= 0x030700A3
25195 tmp_type = tstate->exc_state.exc_type;
25196 tmp_value = tstate->exc_state.exc_value;
25197 tmp_tb = tstate->exc_state.exc_traceback;
25198 tstate->exc_state.exc_type = *type;
25199 tstate->exc_state.exc_value = *value;
25200 tstate->exc_state.exc_traceback = *tb;
25202 tmp_type = tstate->exc_type;
25203 tmp_value = tstate->exc_value;
25204 tmp_tb = tstate->exc_traceback;
25205 tstate->exc_type = *type;
25206 tstate->exc_value = *value;
25207 tstate->exc_traceback = *tb;
25210 *value = tmp_value;
25214 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25215 PyObject *tmp_type, *tmp_value, *tmp_tb;
25216 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25217 PyErr_SetExcInfo(*type, *value, *tb);
25219 *value = tmp_value;
25225 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25226 PyObject *empty_list = 0;
25227 PyObject *module = 0;
25228 PyObject *global_dict = 0;
25229 PyObject *empty_dict = 0;
25231 #if PY_MAJOR_VERSION < 3
25232 PyObject *py_import;
25233 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25240 empty_list = PyList_New(0);
25245 global_dict = PyModule_GetDict(__pyx_m);
25248 empty_dict = PyDict_New();
25252 #if PY_MAJOR_VERSION >= 3
25254 if (strchr(__Pyx_MODULE_NAME,
'.')) {
25255 module = PyImport_ImportModuleLevelObject(
25256 name, global_dict, empty_dict, list, 1);
25258 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25267 #if PY_MAJOR_VERSION < 3
25268 PyObject *py_level = PyInt_FromLong(level);
25271 module = PyObject_CallFunctionObjArgs(py_import,
25272 name, global_dict, empty_dict, list, py_level, NULL);
25273 Py_DECREF(py_level);
25275 module = PyImport_ImportModuleLevelObject(
25276 name, global_dict, empty_dict, list, level);
25281 #if PY_MAJOR_VERSION < 3
25282 Py_XDECREF(py_import);
25284 Py_XDECREF(empty_list);
25285 Py_XDECREF(empty_dict);
25290 #if CYTHON_COMPILING_IN_CPYTHON
25291 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25297 return b == &PyBaseObject_Type;
25299 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25301 if (a == b)
return 1;
25305 n = PyTuple_GET_SIZE(mro);
25306 for (i = 0; i <
n; i++) {
25307 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25312 return __Pyx_InBases(a, b);
25314 #if PY_MAJOR_VERSION == 2
25315 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25316 PyObject *exception, *value, *tb;
25318 __Pyx_PyThreadState_declare
25319 __Pyx_PyThreadState_assign
25320 __Pyx_ErrFetch(&exception, &value, &tb);
25321 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25322 if (unlikely(res == -1)) {
25323 PyErr_WriteUnraisable(err);
25327 res = PyObject_IsSubclass(err, exc_type2);
25328 if (unlikely(res == -1)) {
25329 PyErr_WriteUnraisable(err);
25333 __Pyx_ErrRestore(exception, value, tb);
25337 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25338 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25340 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25345 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25347 assert(PyExceptionClass_Check(exc_type));
25348 n = PyTuple_GET_SIZE(tuple);
25349 #if PY_MAJOR_VERSION >= 3
25350 for (i=0; i<
n; i++) {
25351 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25354 for (i=0; i<
n; i++) {
25355 PyObject *t = PyTuple_GET_ITEM(tuple, i);
25356 #if PY_MAJOR_VERSION < 3
25357 if (likely(exc_type == t))
return 1;
25359 if (likely(PyExceptionClass_Check(t))) {
25360 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
25366 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25367 if (likely(err == exc_type))
return 1;
25368 if (likely(PyExceptionClass_Check(err))) {
25369 if (likely(PyExceptionClass_Check(exc_type))) {
25370 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25371 }
else if (likely(PyTuple_Check(exc_type))) {
25372 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25376 return PyErr_GivenExceptionMatches(err, exc_type);
25378 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25379 assert(PyExceptionClass_Check(exc_type1));
25380 assert(PyExceptionClass_Check(exc_type2));
25381 if (likely(err == exc_type1 || err == exc_type2))
return 1;
25382 if (likely(PyExceptionClass_Check(err))) {
25383 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25385 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25390 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
25391 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
25395 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
25398 q -= ((
r != 0) & ((
r ^ b) < 0));
25403 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25404 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25405 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25406 PyErr_Format(PyExc_ImportError,
25407 #
if PY_MAJOR_VERSION < 3
25408 "cannot import name %.230s", PyString_AS_STRING(name));
25410 "cannot import name %S", name);
25417 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
25419 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
25420 PyErr_SetString(PyExc_TypeError,
25421 "hasattr(): attribute name must be string");
25424 r = __Pyx_GetAttr(o,
n);
25425 if (unlikely(!
r)) {
25435 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25436 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25437 PyErr_Format(PyExc_AttributeError,
25438 #
if PY_MAJOR_VERSION >= 3
25439 "'%.50s' object has no attribute '%U'",
25440 tp->tp_name, attr_name);
25442 "'%.50s' object has no attribute '%.400s'",
25443 tp->tp_name, PyString_AS_STRING(attr_name));
25447 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25449 PyTypeObject *tp = Py_TYPE(obj);
25450 if (unlikely(!PyString_Check(attr_name))) {
25451 return PyObject_GenericGetAttr(obj, attr_name);
25453 assert(!tp->tp_dictoffset);
25454 descr = _PyType_Lookup(tp, attr_name);
25455 if (unlikely(!descr)) {
25456 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25459 #if PY_MAJOR_VERSION < 3
25460 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25463 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
25465 PyObject *res =
f(descr, obj, (PyObject *)tp);
25475 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25476 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25477 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25478 return PyObject_GenericGetAttr(obj, attr_name);
25480 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25485 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25487 PyObject *name_attr;
25488 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25489 if (likely(name_attr)) {
25490 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25494 if (unlikely(ret < 0)) {
25498 Py_XDECREF(name_attr);
25501 static int __Pyx_setup_reduce(PyObject* type_obj) {
25503 PyObject *object_reduce = NULL;
25504 PyObject *object_reduce_ex = NULL;
25505 PyObject *reduce = NULL;
25506 PyObject *reduce_ex = NULL;
25507 PyObject *reduce_cython = NULL;
25508 PyObject *setstate = NULL;
25509 PyObject *setstate_cython = NULL;
25510 #if CYTHON_USE_PYTYPE_LOOKUP
25511 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
25513 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
25515 #if CYTHON_USE_PYTYPE_LOOKUP
25516 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
25518 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
25520 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
25521 if (reduce_ex == object_reduce_ex) {
25522 #if CYTHON_USE_PYTYPE_LOOKUP
25523 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
25525 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
25527 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
25528 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25529 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
25530 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
25531 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
25532 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25533 if (!setstate) PyErr_Clear();
25534 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25535 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
25536 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
25537 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
25539 PyType_Modified((PyTypeObject*)type_obj);
25544 if (!PyErr_Occurred())
25545 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25548 #if !CYTHON_USE_PYTYPE_LOOKUP
25549 Py_XDECREF(object_reduce);
25550 Py_XDECREF(object_reduce_ex);
25552 Py_XDECREF(reduce);
25553 Py_XDECREF(reduce_ex);
25554 Py_XDECREF(reduce_cython);
25555 Py_XDECREF(setstate);
25556 Py_XDECREF(setstate_cython);
25561 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
25562 #if PY_VERSION_HEX >= 0x02070000
25563 PyObject *ob = PyCapsule_New(vtable, 0, 0);
25565 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25569 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25579 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
25580 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
25581 for (i=0; i < nbases; i++) {
25582 PyTypeObject *tmptype;
25583 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
25584 tmptype = Py_TYPE(tmp);
25585 #if PY_MAJOR_VERSION < 3
25586 if (tmptype == &PyClass_Type)
25590 metaclass = tmptype;
25593 if (PyType_IsSubtype(metaclass, tmptype))
25595 if (PyType_IsSubtype(tmptype, metaclass)) {
25596 metaclass = tmptype;
25599 PyErr_SetString(PyExc_TypeError,
25600 "metaclass conflict: "
25601 "the metaclass of a derived class "
25602 "must be a (non-strict) subclass "
25603 "of the metaclasses of all its bases");
25607 #if PY_MAJOR_VERSION < 3
25608 metaclass = &PyClass_Type;
25610 metaclass = &PyType_Type;
25613 Py_INCREF((PyObject*) metaclass);
25614 return (PyObject*) metaclass;
25618 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25619 PyObject* fake_module;
25620 PyTypeObject* cached_type = NULL;
25621 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
25622 if (!fake_module)
return NULL;
25623 Py_INCREF(fake_module);
25624 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25626 if (!PyType_Check((PyObject*)cached_type)) {
25627 PyErr_Format(PyExc_TypeError,
25628 "Shared Cython type %.200s is not a type object",
25632 if (cached_type->tp_basicsize != type->tp_basicsize) {
25633 PyErr_Format(PyExc_TypeError,
25634 "Shared Cython type %.200s has the wrong size, try recompiling",
25639 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
25641 if (PyType_Ready(type) < 0)
goto bad;
25642 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25645 cached_type = type;
25648 Py_DECREF(fake_module);
25649 return cached_type;
25651 Py_XDECREF(cached_type);
25652 cached_type = NULL;
25657 #include <structmember.h>
25659 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
25661 if (unlikely(op->func_doc == NULL)) {
25662 if (op->func.m_ml->ml_doc) {
25663 #if PY_MAJOR_VERSION >= 3
25664 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25666 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25668 if (unlikely(op->func_doc == NULL))
25671 Py_INCREF(Py_None);
25675 Py_INCREF(op->func_doc);
25676 return op->func_doc;
25679 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
25681 PyObject *tmp = op->func_doc;
25682 if (value == NULL) {
25686 op->func_doc = value;
25691 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
25693 if (unlikely(op->func_name == NULL)) {
25694 #if PY_MAJOR_VERSION >= 3
25695 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25697 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25699 if (unlikely(op->func_name == NULL))
25702 Py_INCREF(op->func_name);
25703 return op->func_name;
25706 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
25709 #if PY_MAJOR_VERSION >= 3
25710 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
25712 if (unlikely(value == NULL || !PyString_Check(value))) {
25714 PyErr_SetString(PyExc_TypeError,
25715 "__name__ must be set to a string object");
25718 tmp = op->func_name;
25720 op->func_name = value;
25725 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
25727 Py_INCREF(op->func_qualname);
25728 return op->func_qualname;
25731 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
25734 #if PY_MAJOR_VERSION >= 3
25735 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
25737 if (unlikely(value == NULL || !PyString_Check(value))) {
25739 PyErr_SetString(PyExc_TypeError,
25740 "__qualname__ must be set to a string object");
25743 tmp = op->func_qualname;
25745 op->func_qualname = value;
25750 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
25753 self = m->func_closure;
25760 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
25762 if (unlikely(op->func_dict == NULL)) {
25763 op->func_dict = PyDict_New();
25764 if (unlikely(op->func_dict == NULL))
25767 Py_INCREF(op->func_dict);
25768 return op->func_dict;
25771 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
25774 if (unlikely(value == NULL)) {
25775 PyErr_SetString(PyExc_TypeError,
25776 "function's dictionary may not be deleted");
25779 if (unlikely(!PyDict_Check(value))) {
25780 PyErr_SetString(PyExc_TypeError,
25781 "setting function's dictionary to a non-dict");
25784 tmp = op->func_dict;
25786 op->func_dict = value;
25791 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
25793 Py_INCREF(op->func_globals);
25794 return op->func_globals;
25797 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
25799 Py_INCREF(Py_None);
25803 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
25805 PyObject* result = (op->func_code) ? op->func_code : Py_None;
25810 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25812 PyObject *res = op->defaults_getter((PyObject *) op);
25813 if (unlikely(!res))
25815 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25816 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25817 Py_INCREF(op->defaults_tuple);
25818 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25819 Py_INCREF(op->defaults_kwdict);
25821 op->defaults_tuple = PySequence_ITEM(res, 0);
25822 if (unlikely(!op->defaults_tuple)) result = -1;
25824 op->defaults_kwdict = PySequence_ITEM(res, 1);
25825 if (unlikely(!op->defaults_kwdict)) result = -1;
25832 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
25836 }
else if (value != Py_None && !PyTuple_Check(value)) {
25837 PyErr_SetString(PyExc_TypeError,
25838 "__defaults__ must be set to a tuple object");
25842 tmp = op->defaults_tuple;
25843 op->defaults_tuple = value;
25848 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
25849 PyObject* result = op->defaults_tuple;
25850 if (unlikely(!result)) {
25851 if (op->defaults_getter) {
25852 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25853 result = op->defaults_tuple;
25862 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
25866 }
else if (value != Py_None && !PyDict_Check(value)) {
25867 PyErr_SetString(PyExc_TypeError,
25868 "__kwdefaults__ must be set to a dict object");
25872 tmp = op->defaults_kwdict;
25873 op->defaults_kwdict = value;
25878 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
25879 PyObject* result = op->defaults_kwdict;
25880 if (unlikely(!result)) {
25881 if (op->defaults_getter) {
25882 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25883 result = op->defaults_kwdict;
25892 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
25894 if (!value || value == Py_None) {
25896 }
else if (!PyDict_Check(value)) {
25897 PyErr_SetString(PyExc_TypeError,
25898 "__annotations__ must be set to a dict object");
25902 tmp = op->func_annotations;
25903 op->func_annotations = value;
25908 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
25909 PyObject* result = op->func_annotations;
25910 if (unlikely(!result)) {
25911 result = PyDict_New();
25912 if (unlikely(!result))
return NULL;
25913 op->func_annotations = result;
25918 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25919 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25920 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25921 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25922 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25923 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25924 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25925 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25926 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25927 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25928 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25929 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25930 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25931 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25932 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25933 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25934 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25935 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25936 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25939 static PyMemberDef __pyx_CyFunction_members[] = {
25940 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25944 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25946 #if PY_MAJOR_VERSION >= 3
25947 return PyUnicode_FromString(m->func.m_ml->ml_name);
25949 return PyString_FromString(m->func.m_ml->ml_name);
25952 static PyMethodDef __pyx_CyFunction_methods[] = {
25953 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25956 #if PY_VERSION_HEX < 0x030500A0
25957 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25959 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25961 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml,
int flags, PyObject* qualname,
25962 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25963 __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
25967 __Pyx_CyFunction_weakreflist(op) = NULL;
25968 op->func.m_ml = ml;
25969 op->func.m_self = (PyObject *) op;
25970 Py_XINCREF(closure);
25971 op->func_closure = closure;
25972 Py_XINCREF(module);
25973 op->func.m_module = module;
25974 op->func_dict = NULL;
25975 op->func_name = NULL;
25976 Py_INCREF(qualname);
25977 op->func_qualname = qualname;
25978 op->func_doc = NULL;
25979 op->func_classobj = NULL;
25980 op->func_globals = globals;
25981 Py_INCREF(op->func_globals);
25983 op->func_code = code;
25984 op->defaults_pyobjects = 0;
25985 op->defaults = NULL;
25986 op->defaults_tuple = NULL;
25987 op->defaults_kwdict = NULL;
25988 op->defaults_getter = NULL;
25989 op->func_annotations = NULL;
25990 PyObject_GC_Track(op);
25991 return (PyObject *) op;
25994 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25996 Py_CLEAR(m->func_closure);
25997 Py_CLEAR(m->func.m_module);
25998 Py_CLEAR(m->func_dict);
25999 Py_CLEAR(m->func_name);
26000 Py_CLEAR(m->func_qualname);
26001 Py_CLEAR(m->func_doc);
26002 Py_CLEAR(m->func_globals);
26003 Py_CLEAR(m->func_code);
26004 Py_CLEAR(m->func_classobj);
26005 Py_CLEAR(m->defaults_tuple);
26006 Py_CLEAR(m->defaults_kwdict);
26007 Py_CLEAR(m->func_annotations);
26009 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26011 for (i = 0; i < m->defaults_pyobjects; i++)
26012 Py_XDECREF(pydefaults[i]);
26013 PyObject_Free(m->defaults);
26014 m->defaults = NULL;
26018 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26020 if (__Pyx_CyFunction_weakreflist(m) != NULL)
26021 PyObject_ClearWeakRefs((PyObject *) m);
26022 __Pyx_CyFunction_clear(m);
26023 PyObject_GC_Del(m);
26025 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26027 PyObject_GC_UnTrack(m);
26028 __Pyx__CyFunction_dealloc(m);
26030 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
26032 Py_VISIT(m->func_closure);
26033 Py_VISIT(m->func.m_module);
26034 Py_VISIT(m->func_dict);
26035 Py_VISIT(m->func_name);
26036 Py_VISIT(m->func_qualname);
26037 Py_VISIT(m->func_doc);
26038 Py_VISIT(m->func_globals);
26039 Py_VISIT(m->func_code);
26040 Py_VISIT(m->func_classobj);
26041 Py_VISIT(m->defaults_tuple);
26042 Py_VISIT(m->defaults_kwdict);
26044 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26046 for (i = 0; i < m->defaults_pyobjects; i++)
26047 Py_VISIT(pydefaults[i]);
26051 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26053 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26054 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26058 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26060 type = (PyObject *)(Py_TYPE(obj));
26061 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26063 if (obj == Py_None)
26065 return __Pyx_PyMethod_New(func, obj, type);
26068 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26070 #if PY_MAJOR_VERSION >= 3
26071 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
26072 op->func_qualname, (
void *)op);
26074 return PyString_FromFormat(
"<cyfunction %s at %p>",
26075 PyString_AsString(op->func_qualname), (
void *)op);
26078 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
26079 PyCFunctionObject*
f = (PyCFunctionObject*)func;
26080 PyCFunction meth =
f->m_ml->ml_meth;
26082 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26084 if (likely(kw == NULL || PyDict_Size(kw) == 0))
26085 return (*meth)(
self, arg);
26087 case METH_VARARGS | METH_KEYWORDS:
26088 return (*(PyCFunctionWithKeywords)meth)(
self, arg, kw);
26090 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26091 size = PyTuple_GET_SIZE(arg);
26092 if (likely(size == 0))
26093 return (*meth)(
self, NULL);
26094 PyErr_Format(PyExc_TypeError,
26095 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26096 f->m_ml->ml_name, size);
26101 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26102 size = PyTuple_GET_SIZE(arg);
26103 if (likely(size == 1)) {
26104 PyObject *result, *arg0;
26105 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26106 arg0 = PyTuple_GET_ITEM(arg, 0);
26108 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
26110 result = (*meth)(
self, arg0);
26111 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26116 PyErr_Format(PyExc_TypeError,
26117 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26118 f->m_ml->ml_name, size);
26123 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
26124 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26125 "longer supported!");
26128 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
26132 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26133 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26135 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26137 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26138 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26140 PyObject *new_args;
26142 argc = PyTuple_GET_SIZE(args);
26143 new_args = PyTuple_GetSlice(args, 1, argc);
26144 if (unlikely(!new_args))
26146 self = PyTuple_GetItem(args, 0);
26147 if (unlikely(!
self)) {
26148 Py_DECREF(new_args);
26151 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
26152 Py_DECREF(new_args);
26154 result = __Pyx_CyFunction_Call(func, args, kw);
26158 static PyTypeObject __pyx_CyFunctionType_type = {
26159 PyVarObject_HEAD_INIT(0, 0)
26160 "cython_function_or_method",
26161 sizeof(__pyx_CyFunctionObject),
26163 (destructor) __Pyx_CyFunction_dealloc,
26167 #if PY_MAJOR_VERSION < 3
26172 (reprfunc) __Pyx_CyFunction_repr,
26177 __Pyx_CyFunction_CallAsMethod,
26182 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26184 (traverseproc) __Pyx_CyFunction_traverse,
26185 (inquiry) __Pyx_CyFunction_clear,
26187 #
if PY_VERSION_HEX < 0x030500A0
26188 offsetof(__pyx_CyFunctionObject, func_weakreflist),
26190 offsetof(PyCFunctionObject, m_weakreflist),
26194 __pyx_CyFunction_methods,
26195 __pyx_CyFunction_members,
26196 __pyx_CyFunction_getsets,
26199 __Pyx_CyFunction_descr_get,
26201 offsetof(__pyx_CyFunctionObject, func_dict),
26214 #if PY_VERSION_HEX >= 0x030400a1
26218 static int __pyx_CyFunction_init(
void) {
26219 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26220 if (unlikely(__pyx_CyFunctionType == NULL)) {
26225 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
26226 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26227 m->defaults = PyObject_Malloc(size);
26228 if (unlikely(!m->defaults))
26229 return PyErr_NoMemory();
26230 memset(m->defaults, 0, size);
26231 m->defaults_pyobjects = pyobjects;
26232 return m->defaults;
26234 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26235 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26236 m->defaults_tuple = tuple;
26239 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26240 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26241 m->defaults_kwdict = dict;
26244 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26245 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26246 m->func_annotations = dict;
26251 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
26252 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
26255 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
26257 PyObject *pargs = PyTuple_Pack(2, name, bases);
26258 if (unlikely(!pargs)) {
26262 ns = PyObject_Call(prep, pargs, mkw);
26266 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
26276 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_module, modname) < 0))
goto bad;
26277 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_qualname, qualname) < 0))
goto bad;
26278 if (unlikely(doc && PyObject_SetItem(
ns, __pyx_n_s_doc, doc) < 0))
goto bad;
26284 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
26285 PyObject *dict, PyObject *mkw,
26286 int calculate_metaclass,
int allow_py2_metaclass) {
26287 PyObject *result, *margs;
26288 PyObject *owned_metaclass = NULL;
26289 if (allow_py2_metaclass) {
26290 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
26291 if (owned_metaclass) {
26292 metaclass = owned_metaclass;
26293 }
else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
26299 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
26300 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
26301 Py_XDECREF(owned_metaclass);
26302 if (unlikely(!metaclass))
26304 owned_metaclass = metaclass;
26306 margs = PyTuple_Pack(3, name, bases, dict);
26307 if (unlikely(!margs)) {
26310 result = PyObject_Call(metaclass, margs, mkw);
26313 Py_XDECREF(owned_metaclass);
26318 #ifndef CYTHON_CLINE_IN_TRACEBACK
26319 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
26320 PyObject *use_cline;
26321 PyObject *ptype, *pvalue, *ptraceback;
26322 #if CYTHON_COMPILING_IN_CPYTHON
26323 PyObject **cython_runtime_dict;
26325 if (unlikely(!__pyx_cython_runtime)) {
26328 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26329 #if CYTHON_COMPILING_IN_CPYTHON
26330 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26331 if (likely(cython_runtime_dict)) {
26332 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
26336 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26337 if (use_cline_obj) {
26338 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26339 Py_DECREF(use_cline_obj);
26347 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26349 else if (PyObject_Not(use_cline) != 0) {
26352 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26358 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
26359 int start = 0, mid = 0, end = count - 1;
26360 if (end >= 0 && code_line > entries[end].code_line) {
26363 while (start < end) {
26364 mid = start + (end - start) / 2;
26365 if (code_line < entries[mid].code_line) {
26367 }
else if (code_line > entries[mid].code_line) {
26373 if (code_line <= entries[mid].code_line) {
26379 static PyCodeObject *__pyx_find_code_object(
int code_line) {
26380 PyCodeObject* code_object;
26382 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26385 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26386 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
26389 code_object = __pyx_code_cache.entries[
pos].code_object;
26390 Py_INCREF(code_object);
26391 return code_object;
26393 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
26395 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26396 if (unlikely(!code_line)) {
26399 if (unlikely(!entries)) {
26400 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
26401 if (likely(entries)) {
26402 __pyx_code_cache.entries = entries;
26403 __pyx_code_cache.max_count = 64;
26404 __pyx_code_cache.count = 1;
26405 entries[0].code_line = code_line;
26406 entries[0].code_object = code_object;
26407 Py_INCREF(code_object);
26411 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26412 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
26413 PyCodeObject* tmp = entries[
pos].code_object;
26414 entries[
pos].code_object = code_object;
26418 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26419 int new_max = __pyx_code_cache.max_count + 64;
26420 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26421 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
26422 if (unlikely(!entries)) {
26425 __pyx_code_cache.entries = entries;
26426 __pyx_code_cache.max_count = new_max;
26428 for (i=__pyx_code_cache.count; i>
pos; i--) {
26429 entries[i] = entries[i-1];
26431 entries[
pos].code_line = code_line;
26432 entries[
pos].code_object = code_object;
26433 __pyx_code_cache.count++;
26434 Py_INCREF(code_object);
26438 #include "compile.h"
26439 #include "frameobject.h"
26440 #include "traceback.h"
26441 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26442 const char *funcname,
int c_line,
26443 int py_line,
const char *filename) {
26444 PyCodeObject *py_code = 0;
26445 PyObject *py_srcfile = 0;
26446 PyObject *py_funcname = 0;
26447 #if PY_MAJOR_VERSION < 3
26448 py_srcfile = PyString_FromString(filename);
26450 py_srcfile = PyUnicode_FromString(filename);
26452 if (!py_srcfile)
goto bad;
26454 #if PY_MAJOR_VERSION < 3
26455 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26457 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26461 #if PY_MAJOR_VERSION < 3
26462 py_funcname = PyString_FromString(funcname);
26464 py_funcname = PyUnicode_FromString(funcname);
26467 if (!py_funcname)
goto bad;
26468 py_code = __Pyx_PyCode_New(
26485 Py_DECREF(py_srcfile);
26486 Py_DECREF(py_funcname);
26489 Py_XDECREF(py_srcfile);
26490 Py_XDECREF(py_funcname);
26493 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
26494 int py_line,
const char *filename) {
26495 PyCodeObject *py_code = 0;
26496 PyFrameObject *py_frame = 0;
26497 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26499 c_line = __Pyx_CLineForTraceback(tstate, c_line);
26501 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26503 py_code = __Pyx_CreateCodeObjectForTraceback(
26504 funcname, c_line, py_line, filename);
26505 if (!py_code)
goto bad;
26506 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26508 py_frame = PyFrame_New(
26514 if (!py_frame)
goto bad;
26515 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26516 PyTraceBack_Here(py_frame);
26518 Py_XDECREF(py_code);
26519 Py_XDECREF(py_frame);
26522 #if PY_MAJOR_VERSION < 3
26523 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
26524 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
26525 if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray))
return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
26526 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
26527 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
26528 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26531 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26532 PyObject *obj = view->obj;
26534 if (PyObject_CheckBuffer(obj)) {
26535 PyBuffer_Release(view);
26539 else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
26548 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
26550 int i, index, step, start;
26551 Py_ssize_t itemsize = mvs.memview->view.itemsize;
26552 if (order ==
'F') {
26559 for (i = 0; i < ndim; i++) {
26560 index = start + step * i;
26561 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26563 itemsize *= mvs.shape[index];
26570 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26571 void **out_start,
void **out_end,
26572 int ndim,
size_t itemsize)
26576 start = end = slice->data;
26577 for (i = 0; i < ndim; i++) {
26578 Py_ssize_t stride = slice->strides[i];
26579 Py_ssize_t extent = slice->shape[i];
26581 *out_start = *out_end = start;
26585 end += stride * (extent - 1);
26587 start += stride * (extent - 1);
26590 *out_start = start;
26591 *out_end = end + itemsize;
26594 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26595 __Pyx_memviewslice *slice2,
26596 int ndim,
size_t itemsize)
26598 void *start1, *end1, *start2, *end2;
26599 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26600 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26601 return (start1 < end2) && (start2 < end1);
26605 static CYTHON_INLINE PyObject *
26606 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
26609 #if PY_VERSION_HEX >= 0x02070000
26610 cobj = PyCapsule_New(p, sig, NULL);
26612 cobj = PyCObject_FromVoidPtr(p, NULL);
26618 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26619 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26620 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26621 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26622 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26624 func_type value = func_value;\
26625 if (sizeof(target_type) < sizeof(func_type)) {\
26626 if (unlikely(value != (func_type) (target_type) value)) {\
26627 func_type zero = 0;\
26628 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26629 return (target_type) -1;\
26630 if (is_unsigned && unlikely(value < zero))\
26631 goto raise_neg_overflow;\
26633 goto raise_overflow;\
26636 return (target_type) value;\
26640 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
26646 S.u32 = 0x01020304;
26647 return S.u8[0] == 4;
26651 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26652 __Pyx_BufFmt_StackElem* stack,
26653 __Pyx_TypeInfo* type) {
26654 stack[0].field = &ctx->root;
26655 stack[0].parent_offset = 0;
26656 ctx->root.type = type;
26657 ctx->root.name =
"buffer dtype";
26658 ctx->root.offset = 0;
26660 ctx->head->field = &ctx->root;
26661 ctx->fmt_offset = 0;
26662 ctx->head->parent_offset = 0;
26663 ctx->new_packmode =
'@';
26664 ctx->enc_packmode =
'@';
26665 ctx->new_count = 1;
26666 ctx->enc_count = 0;
26668 ctx->is_complex = 0;
26669 ctx->is_valid_array = 0;
26670 ctx->struct_alignment = 0;
26671 while (type->typegroup ==
'S') {
26673 ctx->head->field = type->fields;
26674 ctx->head->parent_offset = 0;
26675 type = type->fields->type;
26678 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
26680 const char* t = *ts;
26681 if (*t < '0' || *t >
'9') {
26684 count = *t++ -
'0';
26685 while (*t >=
'0' && *t <
'9') {
26687 count += *t++ -
'0';
26693 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
26694 int number = __Pyx_BufFmt_ParseNumber(ts);
26696 PyErr_Format(PyExc_ValueError,\
26697 "Does not understand character buffer dtype format string ('%c')", **ts);
26700 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
26701 PyErr_Format(PyExc_ValueError,
26702 "Unexpected format string character: '%c'", ch);
26704 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
26706 case 'c':
return "'char'";
26707 case 'b':
return "'signed char'";
26708 case 'B':
return "'unsigned char'";
26709 case 'h':
return "'short'";
26710 case 'H':
return "'unsigned short'";
26711 case 'i':
return "'int'";
26712 case 'I':
return "'unsigned int'";
26713 case 'l':
return "'long'";
26714 case 'L':
return "'unsigned long'";
26715 case 'q':
return "'long long'";
26716 case 'Q':
return "'unsigned long long'";
26717 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
26718 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
26719 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
26720 case 'T':
return "a struct";
26721 case 'O':
return "Python object";
26722 case 'P':
return "a pointer";
26723 case 's':
case 'p':
return "a string";
26724 case 0:
return "end";
26725 default:
return "unparseable format string";
26728 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
26730 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26731 case 'h':
case 'H':
return 2;
26732 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
26733 case 'q':
case 'Q':
return 8;
26734 case 'f':
return (is_complex ? 8 : 4);
26735 case 'd':
return (is_complex ? 16 : 8);
26737 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
26740 case 'O':
case 'P':
return sizeof(
void*);
26742 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26746 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
26748 case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26749 case 'h':
case 'H':
return sizeof(short);
26750 case 'i':
case 'I':
return sizeof(int);
26751 case 'l':
case 'L':
return sizeof(long);
26752 #ifdef HAVE_LONG_LONG
26753 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
26755 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
26756 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
26757 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
26758 case 'O':
case 'P':
return sizeof(
void*);
26760 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26765 typedef struct {
char c;
short x; } __Pyx_st_short;
26766 typedef struct {
char c;
int x; } __Pyx_st_int;
26767 typedef struct {
char c;
long x; } __Pyx_st_long;
26768 typedef struct {
char c;
float x; } __Pyx_st_float;
26769 typedef struct {
char c;
double x; } __Pyx_st_double;
26770 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
26771 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
26772 #ifdef HAVE_LONG_LONG
26773 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26775 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
26777 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26778 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
26779 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
26780 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
26781 #ifdef HAVE_LONG_LONG
26782 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
26784 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
26785 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
26786 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
26787 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
26789 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26797 typedef struct {
short x;
char c; } __Pyx_pad_short;
26798 typedef struct {
int x;
char c; } __Pyx_pad_int;
26799 typedef struct {
long x;
char c; } __Pyx_pad_long;
26800 typedef struct {
float x;
char c; } __Pyx_pad_float;
26801 typedef struct {
double x;
char c; } __Pyx_pad_double;
26802 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
26803 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
26804 #ifdef HAVE_LONG_LONG
26805 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
26807 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
26809 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26810 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
26811 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
26812 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
26813 #ifdef HAVE_LONG_LONG
26814 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
26816 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
26817 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
26818 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
26819 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
26821 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26825 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
26829 case 'b':
case 'h':
case 'i':
26830 case 'l':
case 'q':
case 's':
case 'p':
26832 case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
26834 case 'f':
case 'd':
case 'g':
26835 return (is_complex ?
'C' :
'R');
26841 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26846 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26847 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26848 const char* expected;
26850 if (ctx->head == NULL) {
26854 expected = ctx->head->field->type->name;
26857 PyErr_Format(PyExc_ValueError,
26858 "Buffer dtype mismatch, expected %s%s%s but got %s",
26859 quote, expected, quote,
26860 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26862 __Pyx_StructField* field = ctx->head->field;
26863 __Pyx_StructField* parent = (ctx->head - 1)->field;
26864 PyErr_Format(PyExc_ValueError,
26865 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26866 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26867 parent->type->name, field->name);
26870 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26872 size_t size, offset, arraysize = 1;
26873 if (ctx->enc_type == 0)
return 0;
26874 if (ctx->head->field->type->arraysize[0]) {
26876 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
26877 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26879 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
26880 PyErr_Format(PyExc_ValueError,
26881 "Expected a dimension of size %zu, got %zu",
26882 ctx->head->field->type->arraysize[0], ctx->enc_count);
26886 if (!ctx->is_valid_array) {
26887 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
26888 ctx->head->field->type->ndim, ndim);
26891 for (i = 0; i < ctx->head->field->type->ndim; i++) {
26892 arraysize *= ctx->head->field->type->arraysize[i];
26894 ctx->is_valid_array = 0;
26895 ctx->enc_count = 1;
26897 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
26899 __Pyx_StructField* field = ctx->head->field;
26900 __Pyx_TypeInfo* type = field->type;
26901 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
26902 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
26904 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
26906 if (ctx->enc_packmode ==
'@') {
26907 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
26908 size_t align_mod_offset;
26909 if (align_at == 0)
return -1;
26910 align_mod_offset = ctx->fmt_offset % align_at;
26911 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
26912 if (ctx->struct_alignment == 0)
26913 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
26916 if (type->size != size || type->typegroup != group) {
26917 if (type->typegroup ==
'C' && type->fields != NULL) {
26918 size_t parent_offset = ctx->head->parent_offset + field->offset;
26920 ctx->head->field = type->fields;
26921 ctx->head->parent_offset = parent_offset;
26924 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
26926 __Pyx_BufFmt_RaiseExpected(ctx);
26930 offset = ctx->head->parent_offset + field->offset;
26931 if (ctx->fmt_offset != offset) {
26932 PyErr_Format(PyExc_ValueError,
26933 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
26934 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
26937 ctx->fmt_offset += size;
26939 ctx->fmt_offset += (arraysize - 1) * size;
26942 if (field == &ctx->root) {
26944 if (ctx->enc_count != 0) {
26945 __Pyx_BufFmt_RaiseExpected(ctx);
26950 ctx->head->field = ++field;
26951 if (field->type == NULL) {
26953 field = ctx->head->field;
26955 }
else if (field->type->typegroup ==
'S') {
26956 size_t parent_offset = ctx->head->parent_offset + field->offset;
26957 if (field->type->fields->type == NULL)
continue;
26958 field = field->type->fields;
26960 ctx->head->field = field;
26961 ctx->head->parent_offset = parent_offset;
26967 }
while (ctx->enc_count);
26969 ctx->is_complex = 0;
26973 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
26975 const char *ts = *tsp;
26977 int ndim = ctx->head->field->type->ndim;
26980 if (ctx->new_count != 1) {
26981 PyErr_SetString(PyExc_ValueError,
26982 "Cannot handle repeated arrays in format string");
26985 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26986 while (*ts && *ts !=
')') {
26988 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
26991 number = __Pyx_BufFmt_ExpectNumber(&ts);
26992 if (
number == -1)
return NULL;
26993 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
26994 return PyErr_Format(PyExc_ValueError,
26995 "Expected a dimension of size %zu, got %d",
26996 ctx->head->field->type->arraysize[i],
number);
26997 if (*ts !=
',' && *ts !=
')')
26998 return PyErr_Format(PyExc_ValueError,
26999 "Expected a comma in format string, got '%c'", *ts);
27000 if (*ts ==
',') ts++;
27004 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
27005 ctx->head->field->type->ndim, i);
27007 PyErr_SetString(PyExc_ValueError,
27008 "Unexpected end of format string, expected ')'");
27011 ctx->is_valid_array = 1;
27012 ctx->new_count = 1;
27016 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
27021 if (ctx->enc_type != 0 && ctx->head == NULL) {
27022 __Pyx_BufFmt_RaiseExpected(ctx);
27025 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27026 if (ctx->head != NULL) {
27027 __Pyx_BufFmt_RaiseExpected(ctx);
27037 if (!__Pyx_Is_Little_Endian()) {
27038 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
27041 ctx->new_packmode =
'=';
27046 if (__Pyx_Is_Little_Endian()) {
27047 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
27050 ctx->new_packmode =
'=';
27056 ctx->new_packmode = *ts++;
27060 const char* ts_after_sub;
27061 size_t i, struct_count = ctx->new_count;
27062 size_t struct_alignment = ctx->struct_alignment;
27063 ctx->new_count = 1;
27066 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
27069 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27071 ctx->enc_count = 0;
27072 ctx->struct_alignment = 0;
27075 for (i = 0; i != struct_count; ++i) {
27076 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27077 if (!ts_after_sub)
return NULL;
27080 if (struct_alignment) ctx->struct_alignment = struct_alignment;
27085 size_t alignment = ctx->struct_alignment;
27087 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27089 if (alignment && ctx->fmt_offset % alignment) {
27090 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27095 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27096 ctx->fmt_offset += ctx->new_count;
27097 ctx->new_count = 1;
27098 ctx->enc_count = 0;
27100 ctx->enc_packmode = ctx->new_packmode;
27106 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
27107 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
27110 CYTHON_FALLTHROUGH;
27111 case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
27112 case 'l':
case 'L':
case 'q':
case 'Q':
27113 case 'f':
case 'd':
case 'g':
27114 case 'O':
case 'p':
27115 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
27116 ctx->enc_packmode == ctx->new_packmode) {
27117 ctx->enc_count += ctx->new_count;
27118 ctx->new_count = 1;
27123 CYTHON_FALLTHROUGH;
27125 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27126 ctx->enc_count = ctx->new_count;
27127 ctx->enc_packmode = ctx->new_packmode;
27128 ctx->enc_type = *ts;
27129 ctx->is_complex = got_Z;
27131 ctx->new_count = 1;
27136 while(*ts !=
':') ++ts;
27140 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
27144 int number = __Pyx_BufFmt_ExpectNumber(&ts);
27145 if (
number == -1)
return NULL;
27146 ctx->new_count = (size_t)
number;
27154 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27161 if (a->size != b->size || a->typegroup != b->typegroup ||
27162 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27163 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
27164 return a->size == b->size;
27170 for (i = 0; i < a->ndim; i++)
27171 if (a->arraysize[i] != b->arraysize[i])
27174 if (a->typegroup ==
'S') {
27175 if (a->flags != b->flags)
27177 if (a->fields || b->fields) {
27178 if (!(a->fields && b->fields))
27180 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27181 __Pyx_StructField *field_a = a->fields + i;
27182 __Pyx_StructField *field_b = b->fields + i;
27183 if (field_a->offset != field_b->offset ||
27184 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27187 return !a->fields[i].type && !b->fields[i].type;
27195 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
27197 if (buf->shape[dim] <= 1)
27199 if (buf->strides) {
27200 if (spec & __Pyx_MEMVIEW_CONTIG) {
27201 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27202 if (buf->strides[dim] !=
sizeof(
void *)) {
27203 PyErr_Format(PyExc_ValueError,
27204 "Buffer is not indirectly contiguous "
27205 "in dimension %d.", dim);
27208 }
else if (buf->strides[dim] != buf->itemsize) {
27209 PyErr_SetString(PyExc_ValueError,
27210 "Buffer and memoryview are not contiguous "
27211 "in the same dimension.");
27215 if (spec & __Pyx_MEMVIEW_FOLLOW) {
27216 Py_ssize_t stride = buf->strides[dim];
27219 if (stride < buf->itemsize) {
27220 PyErr_SetString(PyExc_ValueError,
27221 "Buffer and memoryview are not contiguous "
27222 "in the same dimension.");
27227 if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
27228 PyErr_Format(PyExc_ValueError,
27229 "C-contiguous buffer is not contiguous in "
27230 "dimension %d", dim);
27232 }
else if (spec & (__Pyx_MEMVIEW_PTR)) {
27233 PyErr_Format(PyExc_ValueError,
27234 "C-contiguous buffer is not indirect in "
27235 "dimension %d", dim);
27237 }
else if (buf->suboffsets) {
27238 PyErr_SetString(PyExc_ValueError,
27239 "Buffer exposes suboffsets but no strides");
27248 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
27250 if (spec & __Pyx_MEMVIEW_DIRECT) {
27251 if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
27252 PyErr_Format(PyExc_ValueError,
27253 "Buffer not compatible with direct access "
27254 "in dimension %d.", dim);
27258 if (spec & __Pyx_MEMVIEW_PTR) {
27259 if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
27260 PyErr_Format(PyExc_ValueError,
27261 "Buffer is not indirectly accessible "
27262 "in dimension %d.", dim);
27271 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
27274 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27275 Py_ssize_t stride = 1;
27276 for (i = 0; i < ndim; i++) {
27277 if (stride * buf->itemsize != buf->strides[i] &&
27280 PyErr_SetString(PyExc_ValueError,
27281 "Buffer not fortran contiguous.");
27284 stride = stride * buf->shape[i];
27286 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27287 Py_ssize_t stride = 1;
27288 for (i = ndim - 1; i >- 1; i--) {
27289 if (stride * buf->itemsize != buf->strides[i] &&
27290 buf->shape[i] > 1) {
27291 PyErr_SetString(PyExc_ValueError,
27292 "Buffer not C contiguous.");
27295 stride = stride * buf->shape[i];
27302 static int __Pyx_ValidateAndInit_memviewslice(
27307 __Pyx_TypeInfo *dtype,
27308 __Pyx_BufFmt_StackElem stack[],
27309 __Pyx_memviewslice *memviewslice,
27310 PyObject *original_obj)
27312 struct __pyx_memoryview_obj *memview, *new_memview;
27313 __Pyx_RefNannyDeclarations
27315 int i, spec = 0, retval = -1;
27316 __Pyx_BufFmt_Context ctx;
27317 int from_memoryview = __pyx_memoryview_check(original_obj);
27318 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
27319 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
27320 original_obj)->typeinfo)) {
27321 memview = (
struct __pyx_memoryview_obj *) original_obj;
27322 new_memview = NULL;
27324 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27325 original_obj, buf_flags, 0, dtype);
27326 new_memview = memview;
27327 if (unlikely(!memview))
27330 buf = &memview->view;
27331 if (buf->ndim != ndim) {
27332 PyErr_Format(PyExc_ValueError,
27333 "Buffer has wrong number of dimensions (expected %d, got %d)",
27338 __Pyx_BufFmt_Init(&ctx, stack, dtype);
27339 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
27341 if ((
unsigned) buf->itemsize != dtype->size) {
27342 PyErr_Format(PyExc_ValueError,
27343 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
27344 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
27346 (buf->itemsize > 1) ?
"s" :
"",
27349 (dtype->size > 1) ?
"s" :
"");
27352 for (i = 0; i < ndim; i++) {
27353 spec = axes_specs[i];
27354 if (!__pyx_check_strides(buf, i, ndim, spec))
27356 if (!__pyx_check_suboffsets(buf, i, ndim, spec))
27359 if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
27361 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27362 new_memview != NULL) == -1)) {
27368 Py_XDECREF(new_memview);
27371 __Pyx_RefNannyFinishContext();
27376 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj,
int writable_flag) {
27377 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27378 __Pyx_BufFmt_StackElem stack[1];
27379 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27381 if (obj == Py_None) {
27382 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27385 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27386 PyBUF_RECORDS_RO | writable_flag, 1,
27387 &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
27389 if (unlikely(retcode == -1))
27393 result.memview = NULL;
27394 result.data = NULL;
27399 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj,
int writable_flag) {
27400 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27401 __Pyx_BufFmt_StackElem stack[1];
27402 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27404 if (obj == Py_None) {
27405 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27408 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27409 PyBUF_RECORDS_RO | writable_flag, 1,
27410 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
27412 if (unlikely(retcode == -1))
27416 result.memview = NULL;
27417 result.data = NULL;
27422 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
27423 const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
27424 const int is_unsigned = neg_one > const_zero;
27426 if (
sizeof(npy_int32) <
sizeof(long)) {
27427 return PyInt_FromLong((
long) value);
27428 }
else if (
sizeof(npy_int32) <=
sizeof(
unsigned long)) {
27429 return PyLong_FromUnsignedLong((
unsigned long) value);
27430 #ifdef HAVE_LONG_LONG
27431 }
else if (
sizeof(npy_int32) <=
sizeof(
unsigned PY_LONG_LONG)) {
27432 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27436 if (
sizeof(npy_int32) <=
sizeof(
long)) {
27437 return PyInt_FromLong((
long) value);
27438 #ifdef HAVE_LONG_LONG
27439 }
else if (
sizeof(npy_int32) <=
sizeof(PY_LONG_LONG)) {
27440 return PyLong_FromLongLong((PY_LONG_LONG) value);
27445 int one = 1;
int little = (int)*(
unsigned char *)&one;
27446 unsigned char *bytes = (
unsigned char *)&value;
27447 return _PyLong_FromByteArray(bytes,
sizeof(npy_int32),
27448 little, !is_unsigned);
27453 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
27454 const int neg_one = (int) -1, const_zero = (
int) 0;
27455 const int is_unsigned = neg_one > const_zero;
27457 if (
sizeof(
int) <
sizeof(long)) {
27458 return PyInt_FromLong((
long) value);
27459 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27460 return PyLong_FromUnsignedLong((
unsigned long) value);
27461 #ifdef HAVE_LONG_LONG
27462 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27463 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27467 if (
sizeof(
int) <=
sizeof(
long)) {
27468 return PyInt_FromLong((
long) value);
27469 #ifdef HAVE_LONG_LONG
27470 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27471 return PyLong_FromLongLong((PY_LONG_LONG) value);
27476 int one = 1;
int little = (int)*(
unsigned char *)&one;
27477 unsigned char *bytes = (
unsigned char *)&value;
27478 return _PyLong_FromByteArray(bytes,
sizeof(
int),
27479 little, !is_unsigned);
27484 #if CYTHON_CCOMPLEX
27486 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27487 return ::std::complex< float >(x, y);
27490 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27491 return x + y*(__pyx_t_float_complex)_Complex_I;
27495 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27496 __pyx_t_float_complex
z;
27504 #if CYTHON_CCOMPLEX
27506 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27507 return (a.real == b.real) && (a.imag == b.imag);
27509 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27510 __pyx_t_float_complex
z;
27511 z.real = a.real + b.real;
27512 z.imag = a.imag + b.imag;
27515 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27516 __pyx_t_float_complex
z;
27517 z.real = a.real - b.real;
27518 z.imag = a.imag - b.imag;
27521 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27522 __pyx_t_float_complex
z;
27523 z.real = a.real * b.real - a.imag * b.imag;
27524 z.imag = a.real * b.imag + a.imag * b.real;
27528 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27530 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27531 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
27532 if (b.real == 0 && b.imag == 0) {
27533 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27535 float r = b.imag / b.real;
27536 float s = 1.0 / (b.real + b.imag *
r);
27537 return __pyx_t_float_complex_from_parts(
27538 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27541 float r = b.real / b.imag;
27542 float s = 1.0 / (b.imag + b.real *
r);
27543 return __pyx_t_float_complex_from_parts(
27544 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27548 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27550 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27552 float denom = b.real * b.real + b.imag * b.imag;
27553 return __pyx_t_float_complex_from_parts(
27554 (a.real * b.real + a.imag * b.imag) / denom,
27555 (a.imag * b.real - a.real * b.imag) / denom);
27559 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27560 __pyx_t_float_complex
z;
27565 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27566 return (a.real == 0) && (a.imag == 0);
27568 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27569 __pyx_t_float_complex
z;
27575 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
27576 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27577 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
27579 return hypotf(
z.real,
z.imag);
27582 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27583 __pyx_t_float_complex
z;
27584 float r, lnr, theta, z_r, z_theta;
27585 if (b.imag == 0 && b.real == (
int)b.real) {
27587 float denom = a.real * a.real + a.imag * a.imag;
27588 a.real = a.real / denom;
27589 a.imag = -a.imag / denom;
27592 switch ((
int)b.real) {
27600 z = __Pyx_c_prod_float(a, a);
27601 return __Pyx_c_prod_float(a, a);
27603 z = __Pyx_c_prod_float(a, a);
27604 return __Pyx_c_prod_float(
z, a);
27606 z = __Pyx_c_prod_float(a, a);
27607 return __Pyx_c_prod_float(
z,
z);
27613 }
else if (b.imag == 0) {
27614 z.real = powf(a.real, b.real);
27617 }
else if (a.real > 0) {
27622 theta = atan2f(0, -1);
27625 r = __Pyx_c_abs_float(a);
27626 theta = atan2f(a.imag, a.real);
27629 z_r = expf(lnr * b.real - theta * b.imag);
27630 z_theta = theta * b.real + lnr * b.imag;
27631 z.real = z_r * cosf(z_theta);
27632 z.imag = z_r * sinf(z_theta);
27639 #if CYTHON_CCOMPLEX
27641 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27642 return ::std::complex< double >(x, y);
27645 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27646 return x + y*(__pyx_t_double_complex)_Complex_I;
27650 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27651 __pyx_t_double_complex
z;
27659 #if CYTHON_CCOMPLEX
27661 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27662 return (a.real == b.real) && (a.imag == b.imag);
27664 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27665 __pyx_t_double_complex
z;
27666 z.real = a.real + b.real;
27667 z.imag = a.imag + b.imag;
27670 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27671 __pyx_t_double_complex
z;
27672 z.real = a.real - b.real;
27673 z.imag = a.imag - b.imag;
27676 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27677 __pyx_t_double_complex
z;
27678 z.real = a.real * b.real - a.imag * b.imag;
27679 z.imag = a.real * b.imag + a.imag * b.real;
27683 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27685 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27686 }
else if (fabs(b.real) >= fabs(b.imag)) {
27687 if (b.real == 0 && b.imag == 0) {
27688 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27690 double r = b.imag / b.real;
27691 double s = 1.0 / (b.real + b.imag *
r);
27692 return __pyx_t_double_complex_from_parts(
27693 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27696 double r = b.real / b.imag;
27697 double s = 1.0 / (b.imag + b.real *
r);
27698 return __pyx_t_double_complex_from_parts(
27699 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27703 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27705 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27707 double denom = b.real * b.real + b.imag * b.imag;
27708 return __pyx_t_double_complex_from_parts(
27709 (a.real * b.real + a.imag * b.imag) / denom,
27710 (a.imag * b.real - a.real * b.imag) / denom);
27714 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27715 __pyx_t_double_complex
z;
27720 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27721 return (a.real == 0) && (a.imag == 0);
27723 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27724 __pyx_t_double_complex
z;
27730 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
27731 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27732 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
27734 return hypot(
z.real,
z.imag);
27737 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27738 __pyx_t_double_complex
z;
27739 double r, lnr, theta, z_r, z_theta;
27740 if (b.imag == 0 && b.real == (
int)b.real) {
27742 double denom = a.real * a.real + a.imag * a.imag;
27743 a.real = a.real / denom;
27744 a.imag = -a.imag / denom;
27747 switch ((
int)b.real) {
27755 z = __Pyx_c_prod_double(a, a);
27756 return __Pyx_c_prod_double(a, a);
27758 z = __Pyx_c_prod_double(a, a);
27759 return __Pyx_c_prod_double(
z, a);
27761 z = __Pyx_c_prod_double(a, a);
27762 return __Pyx_c_prod_double(
z,
z);
27768 }
else if (b.imag == 0) {
27769 z.real = pow(a.real, b.real);
27772 }
else if (a.real > 0) {
27777 theta = atan2(0, -1);
27780 r = __Pyx_c_abs_double(a);
27781 theta = atan2(a.imag, a.real);
27784 z_r = exp(lnr * b.real - theta * b.imag);
27785 z_theta = theta * b.real + lnr * b.imag;
27786 z.real = z_r * cos(z_theta);
27787 z.imag = z_r * sin(z_theta);
27794 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
27795 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) -1, const_zero = (
enum NPY_TYPES) 0;
27796 const int is_unsigned = neg_one > const_zero;
27798 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
27799 return PyInt_FromLong((
long) value);
27800 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
27801 return PyLong_FromUnsignedLong((
unsigned long) value);
27802 #ifdef HAVE_LONG_LONG
27803 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
27804 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27808 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
27809 return PyInt_FromLong((
long) value);
27810 #ifdef HAVE_LONG_LONG
27811 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
27812 return PyLong_FromLongLong((PY_LONG_LONG) value);
27817 int one = 1;
int little = (int)*(
unsigned char *)&one;
27818 unsigned char *bytes = (
unsigned char *)&value;
27819 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
27820 little, !is_unsigned);
27825 static __Pyx_memviewslice
27826 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
27827 const char *mode,
int ndim,
27828 size_t sizeof_dtype,
int contig_flag,
27829 int dtype_is_object)
27831 __Pyx_RefNannyDeclarations
27833 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27834 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27835 Py_buffer *buf = &from_memview->view;
27836 PyObject *shape_tuple = NULL;
27837 PyObject *temp_int = NULL;
27838 struct __pyx_array_obj *array_obj = NULL;
27839 struct __pyx_memoryview_obj *memview_obj = NULL;
27840 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
27841 for (i = 0; i < ndim; i++) {
27842 if (from_mvs->suboffsets[i] >= 0) {
27843 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
27844 "indirect dimensions (axis %d)", i);
27848 shape_tuple = PyTuple_New(ndim);
27849 if (unlikely(!shape_tuple)) {
27852 __Pyx_GOTREF(shape_tuple);
27853 for(i = 0; i < ndim; i++) {
27854 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27855 if(unlikely(!temp_int)) {
27858 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27862 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
27863 if (unlikely(!array_obj)) {
27866 __Pyx_GOTREF(array_obj);
27867 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27868 (PyObject *) array_obj, contig_flag,
27870 from_mvs->memview->typeinfo);
27871 if (unlikely(!memview_obj))
27873 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27875 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27876 dtype_is_object) < 0))
27880 __Pyx_XDECREF(new_mvs.memview);
27881 new_mvs.memview = NULL;
27882 new_mvs.data = NULL;
27884 __Pyx_XDECREF(shape_tuple);
27885 __Pyx_XDECREF(temp_int);
27886 __Pyx_XDECREF(array_obj);
27887 __Pyx_RefNannyFinishContext();
27892 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
27893 const int neg_one = (int) -1, const_zero = (
int) 0;
27894 const int is_unsigned = neg_one > const_zero;
27895 #if PY_MAJOR_VERSION < 3
27896 if (likely(PyInt_Check(x))) {
27897 if (
sizeof(
int) <
sizeof(long)) {
27898 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
27900 long val = PyInt_AS_LONG(x);
27901 if (is_unsigned && unlikely(val < 0)) {
27902 goto raise_neg_overflow;
27908 if (likely(PyLong_Check(x))) {
27910 #if CYTHON_USE_PYLONG_INTERNALS
27911 const digit* digits = ((PyLongObject*)x)->ob_digit;
27912 switch (Py_SIZE(x)) {
27913 case 0:
return (
int) 0;
27914 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
27916 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27917 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27918 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27919 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
27920 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27925 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27926 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27927 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27928 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
27929 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27934 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27935 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27936 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27937 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
27938 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27944 #if CYTHON_COMPILING_IN_CPYTHON
27945 if (unlikely(Py_SIZE(x) < 0)) {
27946 goto raise_neg_overflow;
27950 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27951 if (unlikely(result < 0))
27953 if (unlikely(result == 1))
27954 goto raise_neg_overflow;
27957 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27958 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
27959 #ifdef HAVE_LONG_LONG
27960 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27961 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27965 #if CYTHON_USE_PYLONG_INTERNALS
27966 const digit* digits = ((PyLongObject*)x)->ob_digit;
27967 switch (Py_SIZE(x)) {
27968 case 0:
return (
int) 0;
27969 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
27970 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
27972 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
27973 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27974 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27975 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27976 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27981 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27982 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27983 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27984 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27985 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27990 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27991 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27992 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27993 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27994 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27999 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28000 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28001 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28002 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28003 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28008 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28009 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28010 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28011 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28012 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28017 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28018 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28019 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28020 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28021 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28027 if (
sizeof(
int) <=
sizeof(long)) {
28028 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
28029 #ifdef HAVE_LONG_LONG
28030 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28031 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
28036 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28037 PyErr_SetString(PyExc_RuntimeError,
28038 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28041 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28042 #if PY_MAJOR_VERSION < 3
28043 if (likely(
v) && !PyLong_Check(
v)) {
28045 v = PyNumber_Long(tmp);
28050 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28051 unsigned char *bytes = (
unsigned char *)&val;
28052 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28053 bytes,
sizeof(val),
28054 is_little, !is_unsigned);
28064 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28065 if (!tmp)
return (
int) -1;
28066 val = __Pyx_PyInt_As_int(tmp);
28071 PyErr_SetString(PyExc_OverflowError,
28072 "value too large to convert to int");
28074 raise_neg_overflow:
28075 PyErr_SetString(PyExc_OverflowError,
28076 "can't convert negative value to int");
28081 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
28082 const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
28083 const int is_unsigned = neg_one > const_zero;
28084 #if PY_MAJOR_VERSION < 3
28085 if (likely(PyInt_Check(x))) {
28086 if (
sizeof(npy_int32) <
sizeof(long)) {
28087 __PYX_VERIFY_RETURN_INT(npy_int32,
long, PyInt_AS_LONG(x))
28089 long val = PyInt_AS_LONG(x);
28090 if (is_unsigned && unlikely(val < 0)) {
28091 goto raise_neg_overflow;
28093 return (npy_int32) val;
28097 if (likely(PyLong_Check(x))) {
28099 #if CYTHON_USE_PYLONG_INTERNALS
28100 const digit* digits = ((PyLongObject*)x)->ob_digit;
28101 switch (Py_SIZE(x)) {
28102 case 0:
return (npy_int32) 0;
28103 case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
28105 if (8 *
sizeof(npy_int32) > 1 * PyLong_SHIFT) {
28106 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28107 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28108 }
else if (8 *
sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
28109 return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
28114 if (8 *
sizeof(npy_int32) > 2 * PyLong_SHIFT) {
28115 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28116 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28117 }
else if (8 *
sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
28118 return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
28123 if (8 *
sizeof(npy_int32) > 3 * PyLong_SHIFT) {
28124 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28125 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28126 }
else if (8 *
sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
28127 return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
28133 #if CYTHON_COMPILING_IN_CPYTHON
28134 if (unlikely(Py_SIZE(x) < 0)) {
28135 goto raise_neg_overflow;
28139 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28140 if (unlikely(result < 0))
28141 return (npy_int32) -1;
28142 if (unlikely(result == 1))
28143 goto raise_neg_overflow;
28146 if (
sizeof(npy_int32) <=
sizeof(
unsigned long)) {
28147 __PYX_VERIFY_RETURN_INT_EXC(npy_int32,
unsigned long, PyLong_AsUnsignedLong(x))
28148 #ifdef HAVE_LONG_LONG
28149 }
else if (
sizeof(npy_int32) <=
sizeof(
unsigned PY_LONG_LONG)) {
28150 __PYX_VERIFY_RETURN_INT_EXC(npy_int32,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28154 #if CYTHON_USE_PYLONG_INTERNALS
28155 const digit* digits = ((PyLongObject*)x)->ob_digit;
28156 switch (Py_SIZE(x)) {
28157 case 0:
return (npy_int32) 0;
28158 case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
28159 case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0])
28161 if (8 *
sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
28162 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28163 __PYX_VERIFY_RETURN_INT(npy_int32,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28164 }
else if (8 *
sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
28165 return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28170 if (8 *
sizeof(npy_int32) > 1 * PyLong_SHIFT) {
28171 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28172 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28173 }
else if (8 *
sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
28174 return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28179 if (8 *
sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
28180 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28181 __PYX_VERIFY_RETURN_INT(npy_int32,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28182 }
else if (8 *
sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
28183 return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28188 if (8 *
sizeof(npy_int32) > 2 * PyLong_SHIFT) {
28189 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28190 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28191 }
else if (8 *
sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
28192 return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28197 if (8 *
sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
28198 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28199 __PYX_VERIFY_RETURN_INT(npy_int32,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28200 }
else if (8 *
sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
28201 return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28206 if (8 *
sizeof(npy_int32) > 3 * PyLong_SHIFT) {
28207 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28208 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28209 }
else if (8 *
sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
28210 return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28216 if (
sizeof(npy_int32) <=
sizeof(long)) {
28217 __PYX_VERIFY_RETURN_INT_EXC(npy_int32,
long, PyLong_AsLong(x))
28218 #ifdef HAVE_LONG_LONG
28219 }
else if (
sizeof(npy_int32) <=
sizeof(PY_LONG_LONG)) {
28220 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
28225 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28226 PyErr_SetString(PyExc_RuntimeError,
28227 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28230 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28231 #if PY_MAJOR_VERSION < 3
28232 if (likely(
v) && !PyLong_Check(
v)) {
28234 v = PyNumber_Long(tmp);
28239 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28240 unsigned char *bytes = (
unsigned char *)&val;
28241 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28242 bytes,
sizeof(val),
28243 is_little, !is_unsigned);
28249 return (npy_int32) -1;
28253 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28254 if (!tmp)
return (npy_int32) -1;
28255 val = __Pyx_PyInt_As_npy_int32(tmp);
28260 PyErr_SetString(PyExc_OverflowError,
28261 "value too large to convert to npy_int32");
28262 return (npy_int32) -1;
28263 raise_neg_overflow:
28264 PyErr_SetString(PyExc_OverflowError,
28265 "can't convert negative value to npy_int32");
28266 return (npy_int32) -1;
28270 static CYTHON_INLINE
size_t __Pyx_PyInt_As_size_t(PyObject *x) {
28271 const size_t neg_one = (size_t) -1, const_zero = (
size_t) 0;
28272 const int is_unsigned = neg_one > const_zero;
28273 #if PY_MAJOR_VERSION < 3
28274 if (likely(PyInt_Check(x))) {
28275 if (
sizeof(
size_t) <
sizeof(long)) {
28276 __PYX_VERIFY_RETURN_INT(
size_t,
long, PyInt_AS_LONG(x))
28278 long val = PyInt_AS_LONG(x);
28279 if (is_unsigned && unlikely(val < 0)) {
28280 goto raise_neg_overflow;
28282 return (
size_t) val;
28286 if (likely(PyLong_Check(x))) {
28288 #if CYTHON_USE_PYLONG_INTERNALS
28289 const digit* digits = ((PyLongObject*)x)->ob_digit;
28290 switch (Py_SIZE(x)) {
28291 case 0:
return (
size_t) 0;
28292 case 1: __PYX_VERIFY_RETURN_INT(
size_t, digit, digits[0])
28294 if (8 *
sizeof(
size_t) > 1 * PyLong_SHIFT) {
28295 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28296 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28297 }
else if (8 *
sizeof(
size_t) >= 2 * PyLong_SHIFT) {
28298 return (
size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28303 if (8 *
sizeof(
size_t) > 2 * PyLong_SHIFT) {
28304 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28305 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28306 }
else if (8 *
sizeof(
size_t) >= 3 * PyLong_SHIFT) {
28307 return (
size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28312 if (8 *
sizeof(
size_t) > 3 * PyLong_SHIFT) {
28313 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28314 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28315 }
else if (8 *
sizeof(
size_t) >= 4 * PyLong_SHIFT) {
28316 return (
size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28322 #if CYTHON_COMPILING_IN_CPYTHON
28323 if (unlikely(Py_SIZE(x) < 0)) {
28324 goto raise_neg_overflow;
28328 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28329 if (unlikely(result < 0))
28330 return (
size_t) -1;
28331 if (unlikely(result == 1))
28332 goto raise_neg_overflow;
28335 if (
sizeof(
size_t) <=
sizeof(
unsigned long)) {
28336 __PYX_VERIFY_RETURN_INT_EXC(
size_t,
unsigned long, PyLong_AsUnsignedLong(x))
28337 #ifdef HAVE_LONG_LONG
28338 }
else if (
sizeof(
size_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
28339 __PYX_VERIFY_RETURN_INT_EXC(
size_t,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28343 #if CYTHON_USE_PYLONG_INTERNALS
28344 const digit* digits = ((PyLongObject*)x)->ob_digit;
28345 switch (Py_SIZE(x)) {
28346 case 0:
return (
size_t) 0;
28347 case -1: __PYX_VERIFY_RETURN_INT(
size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
28348 case 1: __PYX_VERIFY_RETURN_INT(
size_t, digit, +digits[0])
28350 if (8 *
sizeof(
size_t) - 1 > 1 * PyLong_SHIFT) {
28351 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28352 __PYX_VERIFY_RETURN_INT(
size_t,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28353 }
else if (8 *
sizeof(
size_t) - 1 > 2 * PyLong_SHIFT) {
28354 return (
size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0])));
28359 if (8 *
sizeof(
size_t) > 1 * PyLong_SHIFT) {
28360 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28361 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28362 }
else if (8 *
sizeof(
size_t) - 1 > 2 * PyLong_SHIFT) {
28363 return (
size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0])));
28368 if (8 *
sizeof(
size_t) - 1 > 2 * PyLong_SHIFT) {
28369 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28370 __PYX_VERIFY_RETURN_INT(
size_t,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28371 }
else if (8 *
sizeof(
size_t) - 1 > 3 * PyLong_SHIFT) {
28372 return (
size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28377 if (8 *
sizeof(
size_t) > 2 * PyLong_SHIFT) {
28378 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28379 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28380 }
else if (8 *
sizeof(
size_t) - 1 > 3 * PyLong_SHIFT) {
28381 return (
size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28386 if (8 *
sizeof(
size_t) - 1 > 3 * PyLong_SHIFT) {
28387 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28388 __PYX_VERIFY_RETURN_INT(
size_t,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28389 }
else if (8 *
sizeof(
size_t) - 1 > 4 * PyLong_SHIFT) {
28390 return (
size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0])));
28395 if (8 *
sizeof(
size_t) > 3 * PyLong_SHIFT) {
28396 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28397 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28398 }
else if (8 *
sizeof(
size_t) - 1 > 4 * PyLong_SHIFT) {
28399 return (
size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0])));
28405 if (
sizeof(
size_t) <=
sizeof(long)) {
28406 __PYX_VERIFY_RETURN_INT_EXC(
size_t,
long, PyLong_AsLong(x))
28407 #ifdef HAVE_LONG_LONG
28408 }
else if (
sizeof(
size_t) <=
sizeof(PY_LONG_LONG)) {
28409 __PYX_VERIFY_RETURN_INT_EXC(
size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
28414 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28415 PyErr_SetString(PyExc_RuntimeError,
28416 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28419 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28420 #if PY_MAJOR_VERSION < 3
28421 if (likely(
v) && !PyLong_Check(
v)) {
28423 v = PyNumber_Long(tmp);
28428 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28429 unsigned char *bytes = (
unsigned char *)&val;
28430 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28431 bytes,
sizeof(val),
28432 is_little, !is_unsigned);
28438 return (
size_t) -1;
28442 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28443 if (!tmp)
return (
size_t) -1;
28444 val = __Pyx_PyInt_As_size_t(tmp);
28449 PyErr_SetString(PyExc_OverflowError,
28450 "value too large to convert to size_t");
28451 return (
size_t) -1;
28452 raise_neg_overflow:
28453 PyErr_SetString(PyExc_OverflowError,
28454 "can't convert negative value to size_t");
28455 return (
size_t) -1;
28459 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
28460 const long neg_one = (long) -1, const_zero = (
long) 0;
28461 const int is_unsigned = neg_one > const_zero;
28462 #if PY_MAJOR_VERSION < 3
28463 if (likely(PyInt_Check(x))) {
28464 if (
sizeof(
long) <
sizeof(long)) {
28465 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
28467 long val = PyInt_AS_LONG(x);
28468 if (is_unsigned && unlikely(val < 0)) {
28469 goto raise_neg_overflow;
28475 if (likely(PyLong_Check(x))) {
28477 #if CYTHON_USE_PYLONG_INTERNALS
28478 const digit* digits = ((PyLongObject*)x)->ob_digit;
28479 switch (Py_SIZE(x)) {
28480 case 0:
return (
long) 0;
28481 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28483 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28484 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28485 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28486 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28487 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28492 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28493 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28494 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28495 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28496 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28501 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28502 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28503 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28504 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28505 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28511 #if CYTHON_COMPILING_IN_CPYTHON
28512 if (unlikely(Py_SIZE(x) < 0)) {
28513 goto raise_neg_overflow;
28517 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28518 if (unlikely(result < 0))
28520 if (unlikely(result == 1))
28521 goto raise_neg_overflow;
28524 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28525 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28526 #ifdef HAVE_LONG_LONG
28527 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28528 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28532 #if CYTHON_USE_PYLONG_INTERNALS
28533 const digit* digits = ((PyLongObject*)x)->ob_digit;
28534 switch (Py_SIZE(x)) {
28535 case 0:
return (
long) 0;
28536 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28537 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28539 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28540 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28541 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28542 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28543 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28548 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28549 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28550 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28551 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28552 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28557 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28558 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28559 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28560 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28561 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28566 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28567 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28568 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28569 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28570 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28575 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28576 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28577 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28578 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28579 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28584 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28585 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28586 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28587 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28588 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28594 if (
sizeof(
long) <=
sizeof(long)) {
28595 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28596 #ifdef HAVE_LONG_LONG
28597 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28598 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28603 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28604 PyErr_SetString(PyExc_RuntimeError,
28605 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28608 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28609 #if PY_MAJOR_VERSION < 3
28610 if (likely(
v) && !PyLong_Check(
v)) {
28612 v = PyNumber_Long(tmp);
28617 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28618 unsigned char *bytes = (
unsigned char *)&val;
28619 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28620 bytes,
sizeof(val),
28621 is_little, !is_unsigned);
28631 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28632 if (!tmp)
return (
long) -1;
28633 val = __Pyx_PyInt_As_long(tmp);
28638 PyErr_SetString(PyExc_OverflowError,
28639 "value too large to convert to long");
28641 raise_neg_overflow:
28642 PyErr_SetString(PyExc_OverflowError,
28643 "can't convert negative value to long");
28648 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
28649 const long neg_one = (long) -1, const_zero = (
long) 0;
28650 const int is_unsigned = neg_one > const_zero;
28652 if (
sizeof(
long) <
sizeof(long)) {
28653 return PyInt_FromLong((
long) value);
28654 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28655 return PyLong_FromUnsignedLong((
unsigned long) value);
28656 #ifdef HAVE_LONG_LONG
28657 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28658 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28662 if (
sizeof(
long) <=
sizeof(
long)) {
28663 return PyInt_FromLong((
long) value);
28664 #ifdef HAVE_LONG_LONG
28665 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28666 return PyLong_FromLongLong((PY_LONG_LONG) value);
28671 int one = 1;
int little = (int)*(
unsigned char *)&one;
28672 unsigned char *bytes = (
unsigned char *)&value;
28673 return _PyLong_FromByteArray(bytes,
sizeof(
long),
28674 little, !is_unsigned);
28679 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
28680 const char neg_one = (char) -1, const_zero = (
char) 0;
28681 const int is_unsigned = neg_one > const_zero;
28682 #if PY_MAJOR_VERSION < 3
28683 if (likely(PyInt_Check(x))) {
28684 if (
sizeof(
char) <
sizeof(long)) {
28685 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
28687 long val = PyInt_AS_LONG(x);
28688 if (is_unsigned && unlikely(val < 0)) {
28689 goto raise_neg_overflow;
28695 if (likely(PyLong_Check(x))) {
28697 #if CYTHON_USE_PYLONG_INTERNALS
28698 const digit* digits = ((PyLongObject*)x)->ob_digit;
28699 switch (Py_SIZE(x)) {
28700 case 0:
return (
char) 0;
28701 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
28703 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28704 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28705 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28706 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
28707 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28712 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28713 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28714 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28715 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
28716 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28721 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28722 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28723 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28724 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
28725 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28731 #if CYTHON_COMPILING_IN_CPYTHON
28732 if (unlikely(Py_SIZE(x) < 0)) {
28733 goto raise_neg_overflow;
28737 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28738 if (unlikely(result < 0))
28740 if (unlikely(result == 1))
28741 goto raise_neg_overflow;
28744 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
28745 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
28746 #ifdef HAVE_LONG_LONG
28747 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
28748 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28752 #if CYTHON_USE_PYLONG_INTERNALS
28753 const digit* digits = ((PyLongObject*)x)->ob_digit;
28754 switch (Py_SIZE(x)) {
28755 case 0:
return (
char) 0;
28756 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
28757 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
28759 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
28760 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28761 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28762 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28763 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28768 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28769 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28770 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28771 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28772 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28777 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28778 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28779 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28780 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28781 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28786 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28787 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28788 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28789 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28790 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28795 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28796 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28797 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28798 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28799 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28804 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28805 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28806 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28807 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28808 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28814 if (
sizeof(
char) <=
sizeof(long)) {
28815 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
28816 #ifdef HAVE_LONG_LONG
28817 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
28818 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28823 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28824 PyErr_SetString(PyExc_RuntimeError,
28825 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28828 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28829 #if PY_MAJOR_VERSION < 3
28830 if (likely(
v) && !PyLong_Check(
v)) {
28832 v = PyNumber_Long(tmp);
28837 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28838 unsigned char *bytes = (
unsigned char *)&val;
28839 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28840 bytes,
sizeof(val),
28841 is_little, !is_unsigned);
28851 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28852 if (!tmp)
return (
char) -1;
28853 val = __Pyx_PyInt_As_char(tmp);
28858 PyErr_SetString(PyExc_OverflowError,
28859 "value too large to convert to char");
28861 raise_neg_overflow:
28862 PyErr_SetString(PyExc_OverflowError,
28863 "can't convert negative value to char");
28868 static int __Pyx_check_binary_version(
void) {
28869 char ctversion[4], rtversion[4];
28870 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28871 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
28872 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28874 PyOS_snprintf(message,
sizeof(message),
28875 "compiletime version %s of module '%.100s' "
28876 "does not match runtime version %s",
28877 ctversion, __Pyx_MODULE_NAME, rtversion);
28878 return PyErr_WarnEx(NULL, message, 1);
28884 #ifndef __PYX_HAVE_RT_ImportModule
28885 #define __PYX_HAVE_RT_ImportModule
28886 static PyObject *__Pyx_ImportModule(
const char *name) {
28887 PyObject *py_name = 0;
28888 PyObject *py_module = 0;
28889 py_name = __Pyx_PyIdentifier_FromString(name);
28892 py_module = PyImport_Import(py_name);
28893 Py_DECREF(py_name);
28896 Py_XDECREF(py_name);
28902 #ifndef __PYX_HAVE_RT_ImportType
28903 #define __PYX_HAVE_RT_ImportType
28904 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
28905 size_t size,
int strict)
28907 PyObject *py_module = 0;
28908 PyObject *result = 0;
28909 PyObject *py_name = 0;
28911 Py_ssize_t basicsize;
28912 #ifdef Py_LIMITED_API
28913 PyObject *py_basicsize;
28915 py_module = __Pyx_ImportModule(module_name);
28918 py_name = __Pyx_PyIdentifier_FromString(class_name);
28921 result = PyObject_GetAttr(py_module, py_name);
28922 Py_DECREF(py_name);
28924 Py_DECREF(py_module);
28928 if (!PyType_Check(result)) {
28929 PyErr_Format(PyExc_TypeError,
28930 "%.200s.%.200s is not a type object",
28931 module_name, class_name);
28934 #ifndef Py_LIMITED_API
28935 basicsize = ((PyTypeObject *)result)->tp_basicsize;
28937 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
28940 basicsize = PyLong_AsSsize_t(py_basicsize);
28941 Py_DECREF(py_basicsize);
28943 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
28946 if (!strict && (
size_t)basicsize > size) {
28947 PyOS_snprintf(warning,
sizeof(warning),
28948 "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
28949 module_name, class_name, basicsize, size);
28950 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
28952 else if ((
size_t)basicsize != size) {
28953 PyErr_Format(PyExc_ValueError,
28954 "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
28955 module_name, class_name, basicsize, size);
28958 return (PyTypeObject *)result;
28960 Py_XDECREF(py_module);
28961 Py_XDECREF(result);
28967 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28969 #if PY_MAJOR_VERSION < 3
28970 if (t->is_unicode) {
28971 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28972 }
else if (t->intern) {
28973 *t->p = PyString_InternFromString(t->s);
28975 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28978 if (t->is_unicode | t->is_str) {
28980 *t->p = PyUnicode_InternFromString(t->s);
28981 }
else if (t->encoding) {
28982 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28984 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28987 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28992 if (PyObject_Hash(*t->p) == -1)
28999 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
29000 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29002 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
29004 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29006 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29007 #if !CYTHON_PEP393_ENABLED
29008 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29010 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29011 if (!defenc)
return NULL;
29012 defenc_c = PyBytes_AS_STRING(defenc);
29013 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29015 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29017 for (
c = defenc_c;
c < end;
c++) {
29018 if ((
unsigned char) (*
c) >= 128) {
29019 PyUnicode_AsASCIIString(o);
29025 *length = PyBytes_GET_SIZE(defenc);
29029 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29030 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
29031 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29032 if (likely(PyUnicode_IS_ASCII(o))) {
29033 *length = PyUnicode_GET_LENGTH(o);
29034 return PyUnicode_AsUTF8(o);
29036 PyUnicode_AsASCIIString(o);
29040 return PyUnicode_AsUTF8AndSize(o, length);
29045 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29046 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29048 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29049 __Pyx_sys_getdefaultencoding_not_ascii &&
29051 PyUnicode_Check(o)) {
29052 return __Pyx_PyUnicode_AsStringAndSize(o, length);
29055 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29056 if (PyByteArray_Check(o)) {
29057 *length = PyByteArray_GET_SIZE(o);
29058 return PyByteArray_AS_STRING(o);
29063 int r = PyBytes_AsStringAndSize(o, &result, length);
29064 if (unlikely(
r < 0)) {
29071 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
29072 int is_true = x == Py_True;
29073 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
29074 else return PyObject_IsTrue(x);
29076 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
29077 #if PY_MAJOR_VERSION >= 3
29078 if (PyLong_Check(result)) {
29079 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29080 "__int__ returned non-int (type %.200s). "
29081 "The ability to return an instance of a strict subclass of int "
29082 "is deprecated, and may be removed in a future version of Python.",
29083 Py_TYPE(result)->tp_name)) {
29090 PyErr_Format(PyExc_TypeError,
29091 "__%.4s__ returned non-%.4s (type %.200s)",
29092 type_name, type_name, Py_TYPE(result)->tp_name);
29096 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29097 #if CYTHON_USE_TYPE_SLOTS
29098 PyNumberMethods *m;
29100 const char *name = NULL;
29101 PyObject *res = NULL;
29102 #if PY_MAJOR_VERSION < 3
29103 if (likely(PyInt_Check(x) || PyLong_Check(x)))
29105 if (likely(PyLong_Check(x)))
29107 return __Pyx_NewRef(x);
29108 #if CYTHON_USE_TYPE_SLOTS
29109 m = Py_TYPE(x)->tp_as_number;
29110 #if PY_MAJOR_VERSION < 3
29111 if (m && m->nb_int) {
29113 res = m->nb_int(x);
29115 else if (m && m->nb_long) {
29117 res = m->nb_long(x);
29120 if (likely(m && m->nb_int)) {
29122 res = m->nb_int(x);
29126 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29127 res = PyNumber_Int(x);
29131 #if PY_MAJOR_VERSION < 3
29132 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29134 if (unlikely(!PyLong_CheckExact(res))) {
29136 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29139 else if (!PyErr_Occurred()) {
29140 PyErr_SetString(PyExc_TypeError,
29141 "an integer is required");
29145 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29148 #if PY_MAJOR_VERSION < 3
29149 if (likely(PyInt_CheckExact(b))) {
29150 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
29151 return PyInt_AS_LONG(b);
29153 return PyInt_AsSsize_t(x);
29156 if (likely(PyLong_CheckExact(b))) {
29157 #if CYTHON_USE_PYLONG_INTERNALS
29158 const digit* digits = ((PyLongObject*)b)->ob_digit;
29159 const Py_ssize_t size = Py_SIZE(b);
29160 if (likely(__Pyx_sst_abs(size) <= 1)) {
29161 ival = likely(size) ? digits[0] : 0;
29162 if (size == -1) ival = -ival;
29167 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29168 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29172 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29173 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29177 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29178 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29182 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29183 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29187 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29188 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29192 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29193 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29199 return PyLong_AsSsize_t(b);
29201 x = PyNumber_Index(b);
29203 ival = PyInt_AsSsize_t(x);
29207 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
29208 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29210 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
29211 return PyInt_FromSize_t(ival);